@titaui/pc 1.7.21 → 1.7.25
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/button/text-btn/index.css +1 -0
- package/lib/components/button/text-btn/index.js +10 -12
- package/lib/components/cascader/index.css +38 -11
- package/lib/components/cascader/index.js +10 -5
- package/lib/components/cascader/time.js +31 -0
- package/lib/components/common-share/index.css +223 -0
- package/lib/components/common-share/index.js +104 -0
- package/lib/components/common-share/publishMblog.js +155 -0
- package/lib/components/common-share/request-apis.js +56 -0
- package/lib/components/common-share/types.js +5 -0
- package/lib/components/follower-visitor/index.css +8 -3
- package/lib/components/form/form-fields/group/index.js +2 -1
- package/lib/components/menus/components/menu-tree/tree-node/index.css +9 -6
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +4 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/lib/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/lib/components/scrollbar/index.js +13 -3
- package/lib/components/select-tags/index.css +28 -18
- package/lib/components/select-tags/index.js +2 -2
- package/lib/components/weekly-report/board.js +43 -0
- package/lib/components/weekly-report/card.js +235 -0
- package/lib/components/weekly-report/common-painter/darwAvatar.js +157 -0
- package/lib/components/weekly-report/common-painter/drawName.js +59 -0
- package/lib/components/weekly-report/common-painter/openDataPainter.js +95 -0
- package/lib/components/weekly-report/common-painter/setSize.js +19 -0
- package/lib/components/weekly-report/common-painter/utils.js +85 -0
- package/lib/components/weekly-report/img/body.png +0 -0
- package/lib/components/weekly-report/img/bofang.png +0 -0
- package/lib/components/weekly-report/img/bottom.png +0 -0
- package/lib/components/weekly-report/img/communication.png +0 -0
- package/lib/components/weekly-report/img/down.png +0 -0
- package/lib/components/weekly-report/img/finish.png +0 -0
- package/lib/components/weekly-report/img/laba.png +0 -0
- package/lib/components/weekly-report/img/praise.png +0 -0
- package/lib/components/weekly-report/img/quote.png +0 -0
- package/lib/components/weekly-report/img/title.png +0 -0
- package/lib/components/weekly-report/img/triangle-pop.png +0 -0
- package/lib/components/weekly-report/img/up.png +0 -0
- package/lib/components/weekly-report/index.css +332 -0
- package/lib/components/weekly-report/index.js +134 -0
- package/lib/components/weekly-report/statistics.js +47 -0
- package/lib/index.js +8 -0
- package/lib/pages/aha2021/index.css +0 -1
- package/lib/pages/new-okr-list/header/filter.js +51 -2
- package/lib/pages/new-okr-list/index.js +44 -5
- package/lib/utils/helpers.js +8 -1
- package/package.json +1 -1
- package/src/components/button/text-btn/index.scss +1 -0
- package/src/components/button/text-btn/index.tsx +13 -13
- package/src/components/button/types.ts +1 -0
- package/src/components/cascader/index.scss +50 -27
- package/src/components/cascader/index.tsx +18 -16
- package/src/components/cascader/time.js +13 -0
- package/src/components/common-share/index.scss +199 -0
- package/src/components/common-share/index.tsx +91 -0
- package/src/components/common-share/publishMblog.tsx +79 -0
- package/src/components/common-share/request-apis.js +37 -0
- package/src/components/common-share/types.ts +4 -0
- package/src/components/follower-visitor/index.scss +9 -4
- package/src/components/form/form-fields/group/index.tsx +3 -3
- package/src/components/menus/components/menu-tree/tree-node/index.scss +2 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-project.js +1 -1
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task-level2.js +2 -2
- package/src/components/okr-detail/components/okr-tree/tree-node/e-node/e-task.js +2 -2
- package/src/components/okr-share/index.tsx +4 -17
- package/src/components/scrollbar/index.tsx +2 -1
- package/src/components/select-tags/index.scss +9 -1
- package/src/components/select-tags/index.tsx +8 -12
- package/src/components/weekly-report/board.tsx +25 -0
- package/src/components/weekly-report/card.tsx +125 -0
- package/src/components/weekly-report/common-painter/darwAvatar.ts +81 -0
- package/src/components/weekly-report/common-painter/drawName.ts +19 -0
- package/src/components/weekly-report/common-painter/openDataPainter.ts +47 -0
- package/src/components/weekly-report/common-painter/setSize.ts +12 -0
- package/src/components/weekly-report/common-painter/utils.ts +83 -0
- package/src/components/weekly-report/img/body.png +0 -0
- package/src/components/weekly-report/img/bofang.png +0 -0
- package/src/components/weekly-report/img/bottom.png +0 -0
- package/src/components/weekly-report/img/communication.png +0 -0
- package/src/components/weekly-report/img/down.png +0 -0
- package/src/components/weekly-report/img/finish.png +0 -0
- package/src/components/weekly-report/img/laba.png +0 -0
- package/src/components/weekly-report/img/praise.png +0 -0
- package/src/components/weekly-report/img/quote.png +0 -0
- package/src/components/weekly-report/img/title.png +0 -0
- package/src/components/weekly-report/img/triangle-pop.png +0 -0
- package/src/components/weekly-report/img/up.png +0 -0
- package/src/components/weekly-report/index.scss +299 -0
- package/src/components/weekly-report/index.tsx +51 -0
- package/src/components/weekly-report/statistics.tsx +28 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +2 -1
- package/src/pages/aha2021/index.scss +0 -1
- package/src/pages/new-okr-list/header/filter.tsx +35 -4
- package/src/pages/new-okr-list/index.tsx +33 -5
- package/src/utils/helpers.ts +4 -1
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
.weekly-report-card__dialog {
|
|
2
|
+
.rc-dialog-content{
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
.weekly-report-card {
|
|
7
|
+
&-wrapper {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
width: 336px;
|
|
10
|
+
height: 548px;
|
|
11
|
+
border-radius: 24px;
|
|
12
|
+
.weekly-report-card-content {
|
|
13
|
+
position: relative;
|
|
14
|
+
top: -66px;
|
|
15
|
+
left: -20px;
|
|
16
|
+
transform: scale(0.9);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&-content {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: 375px;
|
|
24
|
+
height: 710px;
|
|
25
|
+
background: linear-gradient(180deg, #B7D5FF 0%, #186FFF 100%);
|
|
26
|
+
}
|
|
27
|
+
&__title {
|
|
28
|
+
width: 220px;
|
|
29
|
+
height: 40px;
|
|
30
|
+
margin-top: 48px;
|
|
31
|
+
}
|
|
32
|
+
&__date-range {
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
color: #FFFFFF;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
margin-top: 11px;
|
|
38
|
+
}
|
|
39
|
+
&__body {
|
|
40
|
+
position: relative;
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
align-items: center;
|
|
44
|
+
width: 335px;
|
|
45
|
+
height: 452px;
|
|
46
|
+
background: transparent;
|
|
47
|
+
padding-top: 55px;
|
|
48
|
+
border-radius: 12px;
|
|
49
|
+
background-image: url('./img/body.png');
|
|
50
|
+
background-size: 100% 100%;
|
|
51
|
+
}
|
|
52
|
+
&__avatar {
|
|
53
|
+
position: absolute;
|
|
54
|
+
left: 129px;
|
|
55
|
+
top: 17px;
|
|
56
|
+
border: 3px solid #fff;
|
|
57
|
+
border-radius: 50%;
|
|
58
|
+
& > img {
|
|
59
|
+
width: 72px;
|
|
60
|
+
height: 72px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
&__shadow {
|
|
64
|
+
position: absolute;
|
|
65
|
+
box-shadow: 0px 0px 18px 0px rgba(40, 121, 255, 0.4);
|
|
66
|
+
width: 78px;
|
|
67
|
+
height: 78px;
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
top: 135px;
|
|
70
|
+
left: 150px;
|
|
71
|
+
}
|
|
72
|
+
&__userName {
|
|
73
|
+
width: 295px;
|
|
74
|
+
height: 24px;
|
|
75
|
+
margin-top: 46px;
|
|
76
|
+
}
|
|
77
|
+
&__text {
|
|
78
|
+
position: relative;
|
|
79
|
+
z-index: 1;
|
|
80
|
+
font-size: 18px;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
color: #2879FF;
|
|
83
|
+
line-height: 26px;
|
|
84
|
+
margin: 28px 0;
|
|
85
|
+
max-width: 279px;
|
|
86
|
+
text-align: center;
|
|
87
|
+
}
|
|
88
|
+
&__quote {
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 142px;
|
|
91
|
+
left: 20px;
|
|
92
|
+
width: 22px;
|
|
93
|
+
height: 22px;
|
|
94
|
+
}
|
|
95
|
+
&-board {
|
|
96
|
+
width: 154px;
|
|
97
|
+
height: 77px;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
position: relative;
|
|
100
|
+
&__done {
|
|
101
|
+
position: absolute;
|
|
102
|
+
width: 154px;
|
|
103
|
+
height: 154px;
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 50%);
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
&__undone {
|
|
109
|
+
position: absolute;
|
|
110
|
+
width: 154px;
|
|
111
|
+
height: 77px;
|
|
112
|
+
background-color: rgb(234, 241, 254);
|
|
113
|
+
transform-origin: center bottom;
|
|
114
|
+
transform: rotate(90deg);
|
|
115
|
+
// background: radial-gradient(at bottom center,rgb(234, 241, 254) 0,rgb(234, 241, 254) 77px,transparent 77px);
|
|
116
|
+
}
|
|
117
|
+
&__space {
|
|
118
|
+
position: absolute;
|
|
119
|
+
width: 2px;
|
|
120
|
+
height: 77px;
|
|
121
|
+
bottom: 50%;
|
|
122
|
+
right: 50%;
|
|
123
|
+
transform-origin: center bottom;
|
|
124
|
+
background-color: #FFF;
|
|
125
|
+
}
|
|
126
|
+
&__center {
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: flex-start;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
position: absolute;
|
|
131
|
+
bottom: -47px;
|
|
132
|
+
left: 30px;
|
|
133
|
+
width: 94px;
|
|
134
|
+
height: 94px;
|
|
135
|
+
background: #FFF;
|
|
136
|
+
border-radius: 50%;
|
|
137
|
+
font-size: 24px;
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
color: #141C28;
|
|
140
|
+
line-height: 24px;
|
|
141
|
+
&>div {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: flex-end;
|
|
144
|
+
justify-content: center;
|
|
145
|
+
width: 100%;
|
|
146
|
+
height: 47px;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
&__num {
|
|
150
|
+
position: absolute;
|
|
151
|
+
bottom: 0;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
&__comparison {
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
margin-top: 6px;
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
font-weight: 400;
|
|
160
|
+
color: #6F7886;
|
|
161
|
+
line-height: 18px;
|
|
162
|
+
}
|
|
163
|
+
&__direction {
|
|
164
|
+
width: 13px;
|
|
165
|
+
height: 13px;
|
|
166
|
+
margin: 0 2px;
|
|
167
|
+
}
|
|
168
|
+
&__colleague {
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
width: 275px;
|
|
174
|
+
height: 39px;
|
|
175
|
+
padding-top: 7px;
|
|
176
|
+
background-image: url('./img/triangle-pop.png');
|
|
177
|
+
background-size: 100% 100%;
|
|
178
|
+
font-size: 14px;
|
|
179
|
+
font-weight: 400;
|
|
180
|
+
color: #3F4755;
|
|
181
|
+
line-height: 24px;
|
|
182
|
+
margin-top: 6px;
|
|
183
|
+
&>span {
|
|
184
|
+
color: #2879FF;
|
|
185
|
+
margin: 0 5px;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
&__statistics {
|
|
189
|
+
width: 100%;
|
|
190
|
+
padding: 0 20px;
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: space-between;
|
|
195
|
+
margin-top: 29px;
|
|
196
|
+
|
|
197
|
+
&__item {
|
|
198
|
+
position: relative;
|
|
199
|
+
display: flex;
|
|
200
|
+
flex-direction: column;
|
|
201
|
+
align-items: center;
|
|
202
|
+
padding: 7px 12px 0;
|
|
203
|
+
background-position: 0 20px;
|
|
204
|
+
background-size: 36px 36px;
|
|
205
|
+
background-repeat: no-repeat;
|
|
206
|
+
}
|
|
207
|
+
&__finish {
|
|
208
|
+
background-image: url('./img/finish.png');
|
|
209
|
+
}
|
|
210
|
+
&__praise {
|
|
211
|
+
background-image: url('./img/praise.png');
|
|
212
|
+
}
|
|
213
|
+
&__communication {
|
|
214
|
+
background-image: url('./img/communication.png');
|
|
215
|
+
}
|
|
216
|
+
&__num {
|
|
217
|
+
font-size: 22px;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
color: #141C28;
|
|
220
|
+
line-height: 30px;
|
|
221
|
+
}
|
|
222
|
+
&__text {
|
|
223
|
+
font-size: 13px;
|
|
224
|
+
font-weight: 400;
|
|
225
|
+
color: #6F7886;
|
|
226
|
+
line-height: 22px;
|
|
227
|
+
}
|
|
228
|
+
&__tips {
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 0;
|
|
231
|
+
right: 0;
|
|
232
|
+
padding: 0 4px;
|
|
233
|
+
height: 17px;
|
|
234
|
+
background: linear-gradient(180deg, #F99797 0%, #F05E5E 100%);
|
|
235
|
+
border-radius: 9px 9px 9px 1px;
|
|
236
|
+
font-size: 11px;
|
|
237
|
+
color: #FFFFFF;
|
|
238
|
+
line-height: 17px;
|
|
239
|
+
text-align: center;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
&__laba {
|
|
243
|
+
position: absolute;
|
|
244
|
+
left: 0;
|
|
245
|
+
top: 118px;
|
|
246
|
+
width: 94px;
|
|
247
|
+
height: 65px;
|
|
248
|
+
}
|
|
249
|
+
&__bofang {
|
|
250
|
+
position: absolute;
|
|
251
|
+
right: 0;
|
|
252
|
+
top: 130px;
|
|
253
|
+
width: 62px;
|
|
254
|
+
height: 66px;
|
|
255
|
+
z-index: 1;
|
|
256
|
+
}
|
|
257
|
+
&__bottom {
|
|
258
|
+
width: 320px;
|
|
259
|
+
height: 60px;
|
|
260
|
+
margin-top: 15px;
|
|
261
|
+
}
|
|
262
|
+
&__button-container {
|
|
263
|
+
display: flex;
|
|
264
|
+
margin-top: 20px;
|
|
265
|
+
justify-content: center;
|
|
266
|
+
}
|
|
267
|
+
&__download {
|
|
268
|
+
display: flex;
|
|
269
|
+
align-items: center;
|
|
270
|
+
justify-content: center;
|
|
271
|
+
width: 120px;
|
|
272
|
+
height: 36px;
|
|
273
|
+
margin-right: 12px;
|
|
274
|
+
border-radius: 18px;
|
|
275
|
+
border: 1px solid #FFFFFF;
|
|
276
|
+
background-color: transparent;
|
|
277
|
+
font-size: 14px;
|
|
278
|
+
color: #FFF;
|
|
279
|
+
&:hover{
|
|
280
|
+
background-color: transparent;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
&__share {
|
|
284
|
+
display: flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
justify-content: center;
|
|
287
|
+
width: 120px;
|
|
288
|
+
height: 36px;
|
|
289
|
+
border-radius: 18px;
|
|
290
|
+
border: 1px solid #FFFFFF;
|
|
291
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 100%);
|
|
292
|
+
font-size: 14px;
|
|
293
|
+
color: #FFF;
|
|
294
|
+
border: none;
|
|
295
|
+
&:hover{
|
|
296
|
+
background: linear-gradient(360deg, #2879FF 0%, #5B8FF9 100%);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { ReactElement, useRef,useState } from "react";
|
|
2
|
+
import RectBtn from "../button/rect-btn";
|
|
3
|
+
import CommonShare from '../common-share'
|
|
4
|
+
import Card from "./card";
|
|
5
|
+
import "./index.scss";
|
|
6
|
+
|
|
7
|
+
interface Props {}
|
|
8
|
+
|
|
9
|
+
const preCls = "weekly-report-card";
|
|
10
|
+
|
|
11
|
+
function WeeklyReportPreview({onShare}){
|
|
12
|
+
const cardRef = useRef();
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<div style={{ position: "absolute", left: "-999px" }}>
|
|
16
|
+
<Card ref={cardRef} />
|
|
17
|
+
</div>
|
|
18
|
+
<div className={preCls + "-wrapper"}>
|
|
19
|
+
<Card />
|
|
20
|
+
</div>
|
|
21
|
+
<div className={preCls + "__button-container"}>
|
|
22
|
+
<RectBtn
|
|
23
|
+
className={preCls + "__download"}
|
|
24
|
+
onClick={async () => {
|
|
25
|
+
const img = await cardRef.current.getImage();
|
|
26
|
+
const ele = document.createElement("img");
|
|
27
|
+
ele.src = img;
|
|
28
|
+
ele.width = 375;
|
|
29
|
+
ele.style = "position:fixed;z-index:100000;top:0";
|
|
30
|
+
document.body.appendChild(ele);
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
下载图片
|
|
34
|
+
</RectBtn>
|
|
35
|
+
<RectBtn className={preCls + "__share"} onClick={async () => {
|
|
36
|
+
const img = await cardRef.current.getImage();
|
|
37
|
+
onShare(img)
|
|
38
|
+
}}>分享到动态</RectBtn>
|
|
39
|
+
</div>
|
|
40
|
+
</>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function WeeklyReportModal({}: Props): ReactElement {
|
|
45
|
+
const [visible,setVisible] = useState<boolean>()
|
|
46
|
+
return (
|
|
47
|
+
<CommonShare uid={1} visible onClose={()=>setVisible(false)} shareComponent={onShare => <WeeklyReportPreview onShare={onShare}/>}/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default WeeklyReportModal;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react'
|
|
2
|
+
import classnames from 'classnames'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
|
|
6
|
+
}
|
|
7
|
+
const preCls = 'weekly-report-card__statistics'
|
|
8
|
+
function Statistics({}: Props): ReactElement {
|
|
9
|
+
return (
|
|
10
|
+
<div className={preCls}>
|
|
11
|
+
<div className={classnames(preCls+'__item',preCls+'__finish')}>
|
|
12
|
+
<div className={preCls+'__num'}>12</div>
|
|
13
|
+
<div className={preCls+'__text'}>完成任务</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div className={classnames(preCls+'__item',preCls+'__praise')}>
|
|
16
|
+
<div className={preCls+'__num'}>12</div>
|
|
17
|
+
<div className={preCls+'__text'}>获得点赞</div>
|
|
18
|
+
<div className={preCls+'__tips'}>Top1</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div className={classnames(preCls+'__item',preCls+'__communication')}>
|
|
21
|
+
<div className={preCls+'__num'}>12</div>
|
|
22
|
+
<div className={preCls+'__text'}>参与互动</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default Statistics
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -82,4 +82,5 @@ export { default as SelectTags } from "./components/select-tags";
|
|
|
82
82
|
export { default as Cascader } from "./components/cascader";
|
|
83
83
|
export { default as requestApi } from "./utils/request";
|
|
84
84
|
export { default as PointDemo} from './components/point-demo'
|
|
85
|
-
export { default as Scrollbar } from './components/scrollbar'
|
|
85
|
+
export { default as Scrollbar } from './components/scrollbar'
|
|
86
|
+
export { default as WeeklyReport} from './components/weekly-report'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
1
|
+
import React, { useState,useEffect } from "react";
|
|
2
2
|
import Tooltip from "../../../components/tooltip";
|
|
3
3
|
import OkrFilterDrawer from "../../../components/okr-filter-drawer";
|
|
4
4
|
import PeriodSelector from "../../../components/period-selector";
|
|
5
5
|
import { localStorage } from "../../../utils/local-storage";
|
|
6
|
+
import { getQueryString } from "../../../utils/tools";
|
|
6
7
|
import { precls } from "../precls";
|
|
7
8
|
|
|
8
9
|
const Filter = (props) => {
|
|
@@ -24,11 +25,41 @@ const Filter = (props) => {
|
|
|
24
25
|
}
|
|
25
26
|
return num;
|
|
26
27
|
});
|
|
27
|
-
const [cycle, setCycle] = useState<any>(
|
|
28
|
-
|
|
28
|
+
const [cycle, setCycle] = useState<any>(()=>{
|
|
29
|
+
const routerData = getQueryString()
|
|
30
|
+
const {annualNum,cycleType,yqmNum} = routerData
|
|
31
|
+
if(!!annualNum&&!!cycleType&&!!yqmNum){
|
|
32
|
+
return { annualNum,cycleType,yqmNum }
|
|
33
|
+
}
|
|
34
|
+
return useLocalStorage.getItem("okr-filter-cycle") || ""
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
);
|
|
30
38
|
|
|
39
|
+
useEffect(()=>{
|
|
40
|
+
const routerData = getQueryString()
|
|
41
|
+
const {annualNum,cycleType,yqmNum} = routerData
|
|
42
|
+
if(!!annualNum&&!!cycleType&&!!yqmNum){
|
|
43
|
+
let cycle = {annualNum,cycleType,yqmNum}
|
|
44
|
+
setCycle(cycle)
|
|
45
|
+
onSearch(cycle)
|
|
46
|
+
}
|
|
47
|
+
},[])
|
|
48
|
+
|
|
49
|
+
const changeCycleUrl = (s) =>{
|
|
50
|
+
const routerData = getQueryString()
|
|
51
|
+
const {annualNum,cycleType,yqmNum,toUserId} = routerData
|
|
52
|
+
if(!!annualNum&&!!cycleType&&!!yqmNum){
|
|
53
|
+
let origin = window.location.href.split('?')[0]
|
|
54
|
+
let url = `${origin}?cycleType=${s.cycleType}&yqmNum=${s.yqmNum}&annualNum=${s.annualNum}&toUserId=${toUserId}`
|
|
55
|
+
history.pushState('','',url)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
31
61
|
const handleChangeCycle = (s) => {
|
|
62
|
+
changeCycleUrl(s)
|
|
32
63
|
setCycle(s);
|
|
33
64
|
onSearch &&
|
|
34
65
|
onSearch({
|
|
@@ -41,7 +72,7 @@ const Filter = (props) => {
|
|
|
41
72
|
const openFilterDrawer = () => setFilterDrawerVisible(true);
|
|
42
73
|
return (
|
|
43
74
|
<div>
|
|
44
|
-
<div className={`${precls}__header-filter`}>
|
|
75
|
+
<div className={`${precls}__header-filter okr-list__twinkle`} >
|
|
45
76
|
<PeriodSelector
|
|
46
77
|
selected={cycle}
|
|
47
78
|
yearsRange={[2019, 2030]}
|
|
@@ -33,11 +33,18 @@ const NewOkrList = (props) => {
|
|
|
33
33
|
targetCategory: "",
|
|
34
34
|
targetSort: "",
|
|
35
35
|
};
|
|
36
|
-
const filterCycle: any =
|
|
37
|
-
|
|
38
|
-
cycleType
|
|
39
|
-
yqmNum
|
|
40
|
-
|
|
36
|
+
const filterCycle: any = () =>{
|
|
37
|
+
const routerData = getQueryString()
|
|
38
|
+
const {annualNum,cycleType,yqmNum} = routerData
|
|
39
|
+
if(!!annualNum&&!!cycleType&&!!yqmNum){
|
|
40
|
+
return { annualNum,cycleType,yqmNum }
|
|
41
|
+
}
|
|
42
|
+
return useLocalStorage.getItem("okr-filter-cycle") || {
|
|
43
|
+
annualNum: new Date().getFullYear() + "",
|
|
44
|
+
cycleType: "2",
|
|
45
|
+
yqmNum: `${moment().quarter()}`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
41
48
|
|
|
42
49
|
const showWorkExecution =
|
|
43
50
|
getBSGlobal("OkrAdvancedSetting").KRSetting.ShowWorkExecution;
|
|
@@ -171,6 +178,17 @@ const NewOkrList = (props) => {
|
|
|
171
178
|
setCasesVisible(false);
|
|
172
179
|
Toast.Success("成功套用");
|
|
173
180
|
};
|
|
181
|
+
const triggerAnimation = () => {
|
|
182
|
+
//@ts-ignore
|
|
183
|
+
document.querySelector('.tita-okr-list-v2').scrollTop = 0;
|
|
184
|
+
const twinkleEles = document.getElementsByClassName('okr-list__twinkle');
|
|
185
|
+
for (let i = 0; i < twinkleEles.length; i++) {
|
|
186
|
+
twinkleEles[i].classList.add('okr-list__twinkle--animation');
|
|
187
|
+
setTimeout(() => {
|
|
188
|
+
twinkleEles[i].classList.remove('okr-list__twinkle--animation');
|
|
189
|
+
}, 3000);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
174
192
|
const onCasesCloseHandler = () => setCasesVisible(false);
|
|
175
193
|
return (
|
|
176
194
|
<Context.Provider
|
|
@@ -180,6 +198,7 @@ const NewOkrList = (props) => {
|
|
|
180
198
|
departmentName,
|
|
181
199
|
departmentId,
|
|
182
200
|
toUserId,
|
|
201
|
+
|
|
183
202
|
...query,
|
|
184
203
|
}}
|
|
185
204
|
>
|
|
@@ -230,6 +249,15 @@ const NewOkrList = (props) => {
|
|
|
230
249
|
)}
|
|
231
250
|
</Loading>
|
|
232
251
|
<InitCycleSetting SetCycleModal={SetCycleModal} />
|
|
252
|
+
{!loading && (
|
|
253
|
+
<div className='okr-list__check-filter-tips'>
|
|
254
|
+
找不到OKR?试试
|
|
255
|
+
<span className='okr-list__check-filter-btn' onClick={triggerAnimation}>
|
|
256
|
+
检查
|
|
257
|
+
</span>
|
|
258
|
+
顶部筛选条件
|
|
259
|
+
</div>
|
|
260
|
+
)}
|
|
233
261
|
<Dialog
|
|
234
262
|
zIndex={99999}
|
|
235
263
|
noHeadLine
|
package/src/utils/helpers.ts
CHANGED