
--- client/resources/css/common.css
+++ client/resources/css/common.css
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
} |
28 | 28 |
.sub-grid-government{ |
29 | 29 |
display: grid; |
30 |
- grid-template-columns: repeat(5, 1fr); |
|
30 |
+ grid-template-columns: repeat(4, 1fr); |
|
31 | 31 |
grid-template-rows: 0.1fr; |
32 | 32 |
grid-column: 1/5; |
33 | 33 |
gap: 1rem; |
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 |
} |
48 | 48 |
.main-grid-agency { |
49 | 49 |
display: grid; |
50 |
- grid-template-columns: 1fr 1fr 1fr 1fr 1fr; |
|
50 |
+ grid-template-columns: 1fr 1fr 1fr 1fr; |
|
51 | 51 |
grid-template-rows: 0.1fr; |
52 | 52 |
gap: 3rem; |
53 | 53 |
} |
--- client/resources/css/layout.css
+++ client/resources/css/layout.css
... | ... | @@ -16,11 +16,12 @@ |
16 | 16 |
grid-template-columns: 315px 1fr; |
17 | 17 |
grid-template-rows: 0.1fr 2.9fr; |
18 | 18 |
} |
19 |
+ |
|
19 | 20 |
header { |
20 | 21 |
padding: 1rem 3rem; |
21 | 22 |
background-color: white; |
22 | 23 |
grid-area: header; |
23 |
- height: 87px; |
|
24 |
+ height: 87px; |
|
24 | 25 |
z-index: 10; |
25 | 26 |
width: 100%; |
26 | 27 |
} |
... | ... | @@ -28,10 +29,15 @@ |
28 | 29 |
.page-title-span { |
29 | 30 |
font-size: 2.5rem; |
30 | 31 |
font-weight: bold; |
31 |
- |
|
32 | 32 |
} |
33 | 33 |
|
34 |
-nav{ |
|
34 |
+.page-title-inner-span { |
|
35 |
+ margin-left: 1rem; |
|
36 |
+ font-size: 1.5rem; |
|
37 |
+ font-weight: normal; |
|
38 |
+} |
|
39 |
+ |
|
40 |
+nav { |
|
35 | 41 |
height: 100%; |
36 | 42 |
width: 310px; |
37 | 43 |
background-color: #f2f0eb; |
... | ... | @@ -39,15 +45,16 @@ |
39 | 45 |
position: fixed; |
40 | 46 |
z-index: 10; |
41 | 47 |
background: #ffffff; |
42 |
- box-shadow: 1px 0px 6px 2px rgb(0 0 0 / 20%); |
|
48 |
+ box-shadow: 1px 0px 6px 2px rgb(0 0 0 / 20%); |
|
43 | 49 |
} |
44 | 50 |
|
45 |
-.logo { |
|
51 |
+.logo { |
|
46 | 52 |
padding: 3rem 1rem; |
47 | 53 |
font-size: large; |
48 | 54 |
text-align: center; |
49 | 55 |
font-weight: bold; |
50 | 56 |
} |
57 |
+ |
|
51 | 58 |
/* 네비게이션 */ |
52 | 59 |
|
53 | 60 |
|
... | ... | @@ -56,13 +63,14 @@ |
56 | 63 |
font-weight: bold; |
57 | 64 |
margin: 0 3rem; |
58 | 65 |
padding: 1rem 3.2rem; |
59 |
- |
|
66 |
+ |
|
60 | 67 |
} |
61 | 68 |
|
62 | 69 |
/* mui icon */ |
63 | 70 |
.MuiSvgIcon-root { |
64 | 71 |
display: block; |
65 | 72 |
} |
73 |
+ |
|
66 | 74 |
.sidebar-title { |
67 | 75 |
margin: 0 3rem; |
68 | 76 |
padding: 1rem 3.2rem; |
... | ... | @@ -70,38 +78,70 @@ |
70 | 78 |
|
71 | 79 |
.sidebar-title span { |
72 | 80 |
font-weight: bold; |
73 |
- color: #333333; |
|
74 |
- font-family:"KoPubDotumLight"; |
|
81 |
+ color: #333333; |
|
82 |
+ font-family: "KoPubDotumLight"; |
|
75 | 83 |
} |
76 | 84 |
|
77 | 85 |
.sidebar-title .toggle { |
78 | 86 |
transition: transform .3s; |
79 | 87 |
} |
88 |
+ |
|
80 | 89 |
.sidebar-item.open .toggle { |
81 | 90 |
transform: rotate(180deg); |
82 |
- |
|
91 |
+ |
|
83 | 92 |
} |
84 |
-nav li{cursor: pointer;} |
|
85 |
-.sidebar-item{font-size: 1.8rem;} |
|
93 |
+ |
|
94 |
+nav li { |
|
95 |
+ cursor: pointer; |
|
96 |
+} |
|
97 |
+ |
|
98 |
+.sidebar-item { |
|
99 |
+ font-size: 1.8rem; |
|
100 |
+} |
|
101 |
+ |
|
86 | 102 |
.sidebar-item.active, |
87 |
-.sidebar-item:hover{background: #f25430; color: #ffffff; width: 90%; border-top-right-radius: 50px; border-bottom-right-radius: 50px; } |
|
103 |
+.sidebar-item:hover { |
|
104 |
+ background: #f25430; |
|
105 |
+ color: #ffffff; |
|
106 |
+ width: 90%; |
|
107 |
+ border-top-right-radius: 50px; |
|
108 |
+ border-bottom-right-radius: 50px; |
|
109 |
+} |
|
110 |
+ |
|
88 | 111 |
.sidebar-item.active a, |
89 |
-.sidebar-item:hover a{color: #ffffff;} |
|
90 |
-.sidebar-item.active span, .sidebar-item.active .toggle, |
|
91 |
-.sidebar-item:hover span, .sidebar-item:hover .toggle{color: #ffffff;} |
|
92 |
-.sidebar-item.active span, .sidebar-item.active .MuiSvgIcon-root, |
|
93 |
-.sidebar-item:hover span, .sidebar-item:hover .MuiSvgIcon-root{color: #ffffff;} |
|
112 |
+.sidebar-item:hover a { |
|
113 |
+ color: #ffffff; |
|
114 |
+} |
|
115 |
+ |
|
116 |
+.sidebar-item.active span, |
|
117 |
+.sidebar-item.active .toggle, |
|
118 |
+.sidebar-item:hover span, |
|
119 |
+.sidebar-item:hover .toggle { |
|
120 |
+ color: #ffffff; |
|
121 |
+} |
|
122 |
+ |
|
123 |
+.sidebar-item.active span, |
|
124 |
+.sidebar-item.active .MuiSvgIcon-root, |
|
125 |
+.sidebar-item:hover span, |
|
126 |
+.sidebar-item:hover .MuiSvgIcon-root { |
|
127 |
+ color: #ffffff; |
|
128 |
+} |
|
129 |
+ |
|
94 | 130 |
.sidebar-content { |
95 | 131 |
display: none; |
96 | 132 |
color: #ffffff; |
97 | 133 |
} |
98 |
-.sidebar-content a{padding: 1rem 0 1rem 5rem;} |
|
134 |
+ |
|
135 |
+.sidebar-content a { |
|
136 |
+ padding: 1rem 0 1rem 5rem; |
|
137 |
+} |
|
138 |
+ |
|
99 | 139 |
.sidebar-item.open>.sidebar-content { |
100 | 140 |
height: auto; |
101 | 141 |
display: block; |
102 | 142 |
} |
103 | 143 |
|
104 |
-.sidebar-content .sidebar-item:hover { |
|
144 |
+.sidebar-content .sidebar-item:hover { |
|
105 | 145 |
background: #f1bdb1; |
106 | 146 |
color: #ffffff; |
107 | 147 |
} |
... | ... | @@ -111,10 +151,29 @@ |
111 | 151 |
background: #f1bdb1; |
112 | 152 |
color: #ffffff; |
113 | 153 |
} |
114 |
-.info-wrap .usericon{width: 5rem; height: 5rem; border: 1px solid #f25430; border-radius: 50px; margin-right: 2rem;} |
|
115 |
-.header-info-id{font-size: 1.6rem; margin-right: 2rem; color: #733c1d; font-weight: 600;} |
|
116 |
-.header-info-id::after{content: "님"; font-size: 1.6rem;} |
|
117 |
-.info-id, .logout { |
|
154 |
+ |
|
155 |
+.info-wrap .usericon { |
|
156 |
+ width: 5rem; |
|
157 |
+ height: 5rem; |
|
158 |
+ border: 1px solid #f25430; |
|
159 |
+ border-radius: 50px; |
|
160 |
+ margin-right: 2rem; |
|
161 |
+} |
|
162 |
+ |
|
163 |
+.header-info-id { |
|
164 |
+ font-size: 1.6rem; |
|
165 |
+ margin-right: 2rem; |
|
166 |
+ color: #733c1d; |
|
167 |
+ font-weight: 600; |
|
168 |
+} |
|
169 |
+ |
|
170 |
+.header-info-id::after { |
|
171 |
+ content: "님"; |
|
172 |
+ font-size: 1.6rem; |
|
173 |
+} |
|
174 |
+ |
|
175 |
+.info-id, |
|
176 |
+.logout { |
|
118 | 177 |
width: 123px; |
119 | 178 |
height: 40px; |
120 | 179 |
background: #f25430; |
... | ... | @@ -127,17 +186,28 @@ |
127 | 186 |
margin: 0 1rem; |
128 | 187 |
cursor: pointer; |
129 | 188 |
} |
130 |
-.info-id span, .logout span{ |
|
189 |
+ |
|
190 |
+.info-id span, |
|
191 |
+.logout span { |
|
131 | 192 |
margin: 0 auto; |
132 | 193 |
} |
133 |
-.bottom-section{position: absolute; padding: 0 1.6rem; bottom: 5rem;} |
|
134 |
-.logout{background: #f26e50;} |
|
194 |
+ |
|
195 |
+.bottom-section { |
|
196 |
+ position: absolute; |
|
197 |
+ padding: 0 1.6rem; |
|
198 |
+ bottom: 5rem; |
|
199 |
+} |
|
200 |
+ |
|
201 |
+.logout { |
|
202 |
+ background: #f26e50; |
|
203 |
+} |
|
204 |
+ |
|
135 | 205 |
#pages { |
136 | 206 |
max-width: 100%; |
137 | 207 |
padding: 3rem; |
138 | 208 |
background-color: #f4f4f2; |
139 | 209 |
grid-area: main; |
140 |
- height: inherit; |
|
210 |
+ height: inherit; |
|
141 | 211 |
} |
142 | 212 |
|
143 | 213 |
|
... | ... | @@ -151,7 +221,8 @@ |
151 | 221 |
padding: 4rem 5rem; |
152 | 222 |
background-color: #ffffff; |
153 | 223 |
} |
154 |
-.userlist{ |
|
224 |
+ |
|
225 |
+.userlist { |
|
155 | 226 |
box-shadow: 1px 1px 5px 1px rgb(0 0 0 / 20%); |
156 | 227 |
width: 100%; |
157 | 228 |
padding: 4.5rem 2rem; |
... | ... | @@ -166,12 +237,13 @@ |
166 | 237 |
width: 100%; |
167 | 238 |
padding: 1rem 0 0 3rem; |
168 | 239 |
} |
169 |
-.hierarchy-menu a { |
|
240 |
+ |
|
241 |
+.hierarchy-menu a { |
|
170 | 242 |
color: #333333; |
171 | 243 |
text-decoration: none; |
172 | 244 |
} |
173 | 245 |
|
174 |
-.hierarchy-menu a span{ |
|
246 |
+.hierarchy-menu a span { |
|
175 | 247 |
font-size: 1.6rem; |
176 | 248 |
} |
177 | 249 |
|
... | ... | @@ -182,6 +254,7 @@ |
182 | 254 |
padding: 10px 0 0 0; |
183 | 255 |
position: relative; |
184 | 256 |
} |
257 |
+ |
|
185 | 258 |
.hierarchy-menu ul ul:before { |
186 | 259 |
content: ''; |
187 | 260 |
position: absolute; |
... | ... | @@ -190,7 +263,8 @@ |
190 | 263 |
left: 6px; |
191 | 264 |
border-left: 1px dashed #373E4B; |
192 | 265 |
} |
193 |
-.hierarchy-menu > ul ul { |
|
266 |
+ |
|
267 |
+.hierarchy-menu>ul ul { |
|
194 | 268 |
padding-left: 16px; |
195 | 269 |
} |
196 | 270 |
|
... | ... | @@ -199,7 +273,8 @@ |
199 | 273 |
display: block; |
200 | 274 |
position: relative; |
201 | 275 |
} |
202 |
-.hierarchy-menu > ul ul li:before { |
|
276 |
+ |
|
277 |
+.hierarchy-menu>ul ul li:before { |
|
203 | 278 |
content: ''; |
204 | 279 |
display: block; |
205 | 280 |
height: 0px; |
... | ... | @@ -209,7 +284,8 @@ |
209 | 284 |
left: -10px; |
210 | 285 |
top: 16px; |
211 | 286 |
} |
212 |
-.hierarchy-menu > ul ul li:after { |
|
287 |
+ |
|
288 |
+.hierarchy-menu>ul ul li:after { |
|
213 | 289 |
content: ''; |
214 | 290 |
display: block; |
215 | 291 |
height: 43px; |
... | ... | @@ -219,24 +295,29 @@ |
219 | 295 |
left: -10px; |
220 | 296 |
top: -27px; |
221 | 297 |
} |
222 |
-.hierarchy-menu > ul ul li.group-lvl:before { |
|
298 |
+ |
|
299 |
+.hierarchy-menu>ul ul li.group-lvl:before { |
|
223 | 300 |
width: 50px; |
224 | 301 |
} |
225 |
-.hierarchy-menu > ul ul li:first-child:after { |
|
302 |
+ |
|
303 |
+.hierarchy-menu>ul ul li:first-child:after { |
|
226 | 304 |
height: 28px; |
227 | 305 |
top: -12px; |
228 | 306 |
} |
229 | 307 |
|
230 | 308 |
/* Links */ |
231 |
-.hierarchy-menu ul .max-agency{ |
|
309 |
+.hierarchy-menu ul .max-agency { |
|
232 | 310 |
margin-left: 0px; |
233 | 311 |
} |
234 |
-.hierarchy-menu ul .top-agency{ |
|
312 |
+ |
|
313 |
+.hierarchy-menu ul .top-agency { |
|
235 | 314 |
margin-left: 49px; |
236 | 315 |
} |
237 |
-.hierarchy-menu .low-agency{ |
|
316 |
+ |
|
317 |
+.hierarchy-menu .low-agency { |
|
238 | 318 |
margin-left: 50px; |
239 | 319 |
} |
320 |
+ |
|
240 | 321 |
.hierarchy-menu ul a { |
241 | 322 |
display: block; |
242 | 323 |
padding: 6px 0 0 5rem; |
... | ... | @@ -245,15 +326,17 @@ |
245 | 326 |
color: #333333; |
246 | 327 |
transition: 100ms; |
247 | 328 |
} |
329 |
+ |
|
248 | 330 |
.hierarchy-menu ul a:hover { |
249 | 331 |
color: #7e9d9c; |
250 | 332 |
} |
333 |
+ |
|
251 | 334 |
.hierarchy-menu ul a.active { |
252 | 335 |
color: #333333; |
253 | 336 |
font-weight: bold; |
254 | 337 |
} |
255 | 338 |
|
256 |
-.hierarchy-menu li.sub-nav > a:before { |
|
339 |
+.hierarchy-menu li.sub-nav>a:before { |
|
257 | 340 |
position: absolute; |
258 | 341 |
left: 4px; |
259 | 342 |
top: 19px; |
... | ... | @@ -266,17 +349,21 @@ |
266 | 349 |
-webkit-transform: rotate(-45deg); |
267 | 350 |
transform: rotate(-45deg); |
268 | 351 |
} |
269 |
-.hierarchy-menu li.sub-nav.open > a:before { |
|
352 |
+ |
|
353 |
+.hierarchy-menu li.sub-nav.open>a:before { |
|
270 | 354 |
-ms-transform: rotate(45deg); |
271 | 355 |
-webkit-transform: rotate(45deg); |
272 | 356 |
transform: rotate(45deg); |
273 | 357 |
} |
274 |
-.hierarchy-menu li.sub-nav.open > a { |
|
358 |
+ |
|
359 |
+.hierarchy-menu li.sub-nav.open>a { |
|
275 | 360 |
color: #333333; |
276 | 361 |
} |
277 |
-.hierarchy-menu li.sub-nav > ul { |
|
362 |
+ |
|
363 |
+.hierarchy-menu li.sub-nav>ul { |
|
278 | 364 |
display: block; |
279 | 365 |
} |
280 |
-.hierarchy-menu li.sub-nav.open > ul { |
|
366 |
+ |
|
367 |
+.hierarchy-menu li.sub-nav.open>ul { |
|
281 | 368 |
display: block; |
282 |
-} |
|
369 |
+}(No newline at end of file) |
--- client/resources/css/main.css
+++ client/resources/css/main.css
... | ... | @@ -70,9 +70,14 @@ |
70 | 70 |
padding: 1rem 0; |
71 | 71 |
} |
72 | 72 |
|
73 |
+.point { |
|
74 |
+ color: #f25430; |
|
75 |
+ font-weight: 900; |
|
76 |
+ border-bottom: 1px solid #f25430 !important; |
|
77 |
+} |
|
78 |
+ |
|
73 | 79 |
.react-calendar__month-view__days__day--neighboringMonth { |
74 | 80 |
color: #f0f0f0; |
75 |
- ; |
|
76 | 81 |
} |
77 | 82 |
|
78 | 83 |
/* .agency-calendar .react-calendar__month-view__days{overflow: hidden;} */ |
... | ... | @@ -469,12 +474,15 @@ |
469 | 474 |
} |
470 | 475 |
|
471 | 476 |
.statistics-govern li p:nth-of-type(3) { |
472 |
- font-size: 1.6rem; |
|
477 |
+ font-size: 2.6rem; |
|
473 | 478 |
font-weight: bold; |
474 | 479 |
} |
475 | 480 |
|
476 | 481 |
.statistics-govern li p:nth-of-type(3)::after { |
477 | 482 |
content: "명"; |
483 |
+ margin-left: .25rem; |
|
484 |
+ font-size: 1.6rem; |
|
485 |
+ font-weight: normal; |
|
478 | 486 |
} |
479 | 487 |
|
480 | 488 |
.statistics-agency { |
... | ... | @@ -765,10 +773,12 @@ |
765 | 773 |
|
766 | 774 |
.react-calendar__tile--active:enabled:hover, |
767 | 775 |
.react-calendar__tile--active:enabled:focus { |
776 |
+ color: #ffffff !important; |
|
768 | 777 |
background: #e26f49; |
769 | 778 |
} |
770 | 779 |
|
771 | 780 |
.react-calendar__tile--active { |
781 |
+ color: #ffffff !important; |
|
772 | 782 |
background: #e26f49; |
773 | 783 |
} |
774 | 784 |
|
... | ... | @@ -1650,4 +1660,16 @@ |
1650 | 1660 |
|
1651 | 1661 |
.react-datepicker-wrapper { |
1652 | 1662 |
width: 100%; |
1663 |
+} |
|
1664 |
+ |
|
1665 |
+.react-calendar__century-view, |
|
1666 |
+.react-calendar__decade-view__years, |
|
1667 |
+.react-calendar__year-view { |
|
1668 |
+ position: relative; |
|
1669 |
+ z-index: 2; |
|
1670 |
+ background-color: #f0f0f0; |
|
1671 |
+} |
|
1672 |
+ |
|
1673 |
+.combine-left-government3 .react-calendar__month-view__days__day--neighboringMonth { |
|
1674 |
+ display: none; |
|
1653 | 1675 |
}(No newline at end of file) |
--- client/views/component/Calendar.jsx
+++ client/views/component/Calendar.jsx
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 |
//전역 변수 저장 객체 |
17 | 17 |
const state = useSelector((state) => { return state }); |
18 | 18 |
const defaultUserId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['user_id']; |
19 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
19 | 20 |
|
20 | 21 |
const [value, setValue] = useState(new Date()); |
21 | 22 |
//const mark = ["12-04-2023", "21-04-2023", "05-04-2023", "02-04-2023"]; |
... | ... | @@ -31,11 +32,11 @@ |
31 | 32 |
if (todayTemperature.length > 0) { |
32 | 33 |
if (moment(date['date']).format("MM") >= 11 || moment(date['date']).format("MM") <= 2) { |
33 | 34 |
return ( |
34 |
- <p>{Math.min.apply(null, todayTemperature)}</p> |
|
35 |
- ) |
|
36 |
- } else { |
|
37 |
- return ( |
|
38 |
- <p>{Math.max.apply(null, todayTemperature)}</p> |
|
35 |
+ <p>{Math.min.apply(null, todayTemperature)}℃</p> |
|
36 |
+ ) |
|
37 |
+ } else { |
|
38 |
+ return ( |
|
39 |
+ <p>{Math.max.apply(null, todayTemperature)}℃</p> |
|
39 | 40 |
) |
40 | 41 |
} |
41 | 42 |
} else { |
... | ... | @@ -50,14 +51,69 @@ |
50 | 51 |
mark.push(data.visitRecordList[i]['visit_date']); |
51 | 52 |
} |
52 | 53 |
|
54 |
+ //위험 기준 목록 정보 |
|
55 |
+ const [riskStandard, setRiskStandard] = React.useState([]); |
|
56 |
+ //위험 기준 목록 조회 |
|
57 |
+ const riskStandardSelectList = () => { |
|
58 |
+ fetch("/danger/riskStandardSelectList.json", { |
|
59 |
+ method: "POST", |
|
60 |
+ headers: { |
|
61 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
62 |
+ }, |
|
63 |
+ body: JSON.stringify({ government_id: defaultGovernmentId }), |
|
64 |
+ }).then((response) => response.json()).then((data) => { |
|
65 |
+ console.log("위험 기준 목록 조회 결과(건수) : ", data); |
|
66 |
+ data.map((item, idx) => { |
|
67 |
+ if (item['risk_standard_type'] = "TEMP") { |
|
68 |
+ setRiskStandard(item); |
|
69 |
+ } |
|
70 |
+ }) |
|
71 |
+ }).catch((error) => { |
|
72 |
+ console.log('riskStandardSelectList() /danger/riskStandardSelectList.json error : ', error); |
|
73 |
+ }); |
|
74 |
+ } |
|
75 |
+ |
|
76 |
+ React.useEffect(() => { |
|
77 |
+ riskStandardSelectList(); |
|
78 |
+ }, []); |
|
79 |
+ |
|
53 | 80 |
return ( |
54 | 81 |
<> |
55 | 82 |
<Calendar |
56 | 83 |
onChange={setValue} |
57 | 84 |
value={value} |
85 |
+ // tileClassName={({ date, view }) => { |
|
86 |
+ // if (mark.find((x) => x === moment(date).format("YYYY-MM-DD"))) { |
|
87 |
+ // return "highlight"; |
|
88 |
+ // } |
|
89 |
+ // }} |
|
58 | 90 |
tileClassName={({ date, view }) => { |
59 |
- if (mark.find((x) => x === moment(date).format("YYYY-MM-DD"))) { |
|
60 |
- return "highlight"; |
|
91 |
+ let medication = "" |
|
92 |
+ let temperature = "" |
|
93 |
+ data['medication'].map((item, idx) => { |
|
94 |
+ if (item['xName'] === moment(date).format("YYYY-MM-DD")) { |
|
95 |
+ medication = item['sum'] / item['total']; |
|
96 |
+ } |
|
97 |
+ }) |
|
98 |
+ |
|
99 |
+ let todayTemperature = []; |
|
100 |
+ data['temperature'].map((item, idx) => { |
|
101 |
+ if (item['xName'] === moment(date).format("YYYY-MM-DD")) { |
|
102 |
+ todayTemperature.push(item['temperature']); |
|
103 |
+ } |
|
104 |
+ }) |
|
105 |
+ if (todayTemperature.length > 0) { |
|
106 |
+ if (moment(moment(date).format("YYYY-MM-DD")).format("MM") >= 11 || moment(moment(date).format("YYYY-MM-DD")).format("MM") <= 2) { |
|
107 |
+ temperature = Math.min.apply(null, todayTemperature) |
|
108 |
+ } else { |
|
109 |
+ temperature = Math.max.apply(null, todayTemperature) |
|
110 |
+ } |
|
111 |
+ } |
|
112 |
+ |
|
113 |
+ if (medication < 0.5 || riskStandard['risk_standard_start_value'] <= temperature || riskStandard['risk_standard_end_value'] >= temperature) { |
|
114 |
+ if (moment(date).format("YYYY-MM-DD") < moment(new Date()).format("YYYY-MM-DD")) { |
|
115 |
+ return "point"; |
|
116 |
+ } |
|
61 | 117 |
} |
62 | 118 |
}} |
63 | 119 |
onClickDay={(date, event) => { |
... | ... | @@ -72,12 +128,19 @@ |
72 | 128 |
}) |
73 | 129 |
data.onClick(sendData); |
74 | 130 |
}} |
131 |
+ formatDay={(locale, date) => { |
|
132 |
+ if (mark.find((x) => x === moment(date).format("YYYY-MM-DD"))) { |
|
133 |
+ return moment(date).format('DD') + "일 ✔"; |
|
134 |
+ } else { |
|
135 |
+ return moment(date).format('DD') + "일" |
|
136 |
+ } |
|
137 |
+ }} |
|
75 | 138 |
tileContent={({ date, view }) => { |
76 | 139 |
return ( |
77 | 140 |
<> |
78 | 141 |
<div className="calendar-data"> |
79 | 142 |
<div> |
80 |
- <p><small>복약량</small></p> |
|
143 |
+ {/* <p><small>복약량</small></p> */} |
|
81 | 144 |
{data['medication'].map((item, idx) => { |
82 | 145 |
return ( |
83 | 146 |
item['xName'] === moment(date).format("YYYY-MM-DD") ? item['sum'] + '/' + item['total'] : null |
... | ... | @@ -86,7 +149,7 @@ |
86 | 149 |
</div> |
87 | 150 |
<div> |
88 | 151 |
<div> |
89 |
- <p><small>온도(℃)</small></p> |
|
152 |
+ {/* <p><small>온도(℃)</small></p> */} |
|
90 | 153 |
<Temperature date={moment(date).format("YYYY-MM-DD")} /> |
91 | 154 |
</div> |
92 | 155 |
</div> |
--- client/views/component/chart/Chart8.jsx
+++ client/views/component/chart/Chart8.jsx
... | ... | @@ -97,7 +97,6 @@ |
97 | 97 |
// Set data |
98 | 98 |
yAxis.data.setAll(data); |
99 | 99 |
series.data.setAll(data); |
100 |
- sortCategoryAxis(); |
|
101 | 100 |
|
102 | 101 |
// Get series item by category |
103 | 102 |
function getSeriesItem(category) { |
... | ... | @@ -114,48 +113,6 @@ |
114 | 113 |
xAxis: xAxis, |
115 | 114 |
yAxis: yAxis |
116 | 115 |
})); |
117 |
- |
|
118 |
- |
|
119 |
- // Axis sorting |
|
120 |
- function sortCategoryAxis() { |
|
121 |
- |
|
122 |
- // Sort by value |
|
123 |
- series.dataItems.sort(function (x, y) { |
|
124 |
- return x.get("valueX") - y.get("valueX"); // descending |
|
125 |
- //return y.get("valueY") - x.get("valueX"); // ascending |
|
126 |
- }) |
|
127 |
- |
|
128 |
- // Go through each axis item |
|
129 |
- am5.array.each(yAxis.dataItems, function (dataItem) { |
|
130 |
- // get corresponding series item |
|
131 |
- let seriesDataItem = getSeriesItem(dataItem.get("category")); |
|
132 |
- |
|
133 |
- if (seriesDataItem) { |
|
134 |
- // get index of series data item |
|
135 |
- let index = series.dataItems.indexOf(seriesDataItem); |
|
136 |
- // calculate delta position |
|
137 |
- let deltaPosition = (index - dataItem.get("index", 0)) / series.dataItems.length; |
|
138 |
- // set index to be the same as series data item index |
|
139 |
- dataItem.set("index", index); |
|
140 |
- // set deltaPosition instanlty |
|
141 |
- dataItem.set("deltaPosition", -deltaPosition); |
|
142 |
- // animate delta position to 0 |
|
143 |
- dataItem.animate({ |
|
144 |
- key: "deltaPosition", |
|
145 |
- to: 0, |
|
146 |
- duration: 1000, |
|
147 |
- easing: am5.ease.out(am5.ease.cubic) |
|
148 |
- }) |
|
149 |
- } |
|
150 |
- }); |
|
151 |
- |
|
152 |
- // Sort axis items by index. |
|
153 |
- // This changes the order instantly, but as deltaPosition is set, |
|
154 |
- // they keep in the same places and then animate to true positions. |
|
155 |
- yAxis.dataItems.sort(function (x, y) { |
|
156 |
- return x.get("index") - y.get("index"); |
|
157 |
- }); |
|
158 |
- } |
|
159 | 116 |
|
160 | 117 |
// Make stuff animate on load |
161 | 118 |
// https://www.amcharts.com/docs/v5/concepts/animations/ |
--- client/views/layout/Header.jsx
+++ client/views/layout/Header.jsx
... | ... | @@ -16,15 +16,51 @@ |
16 | 16 |
//App Title |
17 | 17 |
const [title, setTitle] = React.useState(''); |
18 | 18 |
|
19 |
+ //전체 대상자(시니어) 수 조회 |
|
20 |
+ const [seniorCount, setSeniorCount] = React.useState(0); |
|
21 |
+ const governmentSeniorCountTotal = () => { |
|
22 |
+ fetch("/stats/governmentSeniorCount.json", { |
|
23 |
+ method: "POST", |
|
24 |
+ headers: { |
|
25 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
26 |
+ }, |
|
27 |
+ body: JSON.stringify({ |
|
28 |
+ 'government_id': state.loginUser['government_id'], |
|
29 |
+ }), |
|
30 |
+ }).then((response) => response.json()).then((data) => { |
|
31 |
+ console.log("전체 대상자(시니어) 수 조회 : ", data); |
|
32 |
+ setSeniorCount(data); |
|
33 |
+ }).catch((error) => { |
|
34 |
+ console.log('governmentSeniorCount() /stats/governmentSeniorCount.json error : ', error); |
|
35 |
+ }); |
|
36 |
+ } |
|
37 |
+ const agencySeniorCountTotal = () => { |
|
38 |
+ fetch("/stats/agencySeniorCount.json", { |
|
39 |
+ method: "POST", |
|
40 |
+ headers: { |
|
41 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
42 |
+ }, |
|
43 |
+ body: JSON.stringify({ 'agency_id': state.loginUser['agency_id'] }), |
|
44 |
+ }).then((response) => response.json()).then((data) => { |
|
45 |
+ console.log("전체 대상자(시니어) 수 조회 : ", data); |
|
46 |
+ setSeniorCount(data); |
|
47 |
+ }).catch((error) => { |
|
48 |
+ console.log('agencySeniorCount() /stats/agencySeniorCount.json error : ', error); |
|
49 |
+ }); |
|
50 |
+ } |
|
51 |
+ |
|
19 | 52 |
React.useEffect(() => { |
20 | 53 |
if (state.loginUser['authority'] == 'ROLE_ADMIN') { |
21 | 54 |
setTitle('올잇메디'); |
22 | 55 |
} else if (state.loginUser['authority'] == 'ROLE_GOVERNMENT') { |
23 | 56 |
setTitle(state.loginUser['government_name']); |
57 |
+ governmentSeniorCountTotal(); |
|
24 | 58 |
} else if (state.loginUser['authority'] == 'ROLE_AGENCYADMIN') { |
25 | 59 |
setTitle(state.loginUser['agency_name']); |
60 |
+ agencySeniorCountTotal(); |
|
26 | 61 |
} else if (state.loginUser['authority'] == 'ROLE_AGENCY') { |
27 | 62 |
setTitle(state.loginUser['agency_name']); |
63 |
+ agencySeniorCountTotal(); |
|
28 | 64 |
} else if (state.loginUser['authority'] == 'ROLE_GUARDIAN') { |
29 | 65 |
setTitle('보호자'); |
30 | 66 |
} |
... | ... | @@ -39,12 +75,26 @@ |
39 | 75 |
: null} |
40 | 76 |
<img src={logo} alt="" /> |
41 | 77 |
</h1> |
42 |
- <span className="page-title-span">{title}</span> |
|
78 |
+ <p className="page-title-span"> |
|
79 |
+ {title} |
|
80 |
+ {state.loginUser['authority'] == 'ROLE_GOVERNMENT' || state.loginUser['authority'] == 'ROLE_AGENCYADMIN' ? |
|
81 |
+ <span className="page-title-inner-span"> |
|
82 |
+ 전체 대상자 {seniorCount}명 |
|
83 |
+ </span> |
|
84 |
+ : state.loginUser['authority'] == 'ROLE_AGENCY' ? |
|
85 |
+ <span className="page-title-inner-span"> |
|
86 |
+ 나의 돌봄 대상자 {seniorCount}명 |
|
87 |
+ </span> |
|
88 |
+ : null |
|
89 |
+ } |
|
90 |
+ </p> |
|
43 | 91 |
<div className="page-title flex flex-align"> |
44 | 92 |
{/* <MenuIcon /> */} |
45 | 93 |
<div className="info-wrap flex"> |
46 | 94 |
{/* <div className="usericon"><PersonIcon sx={{ width:48, height:48,}} /></div> */} |
47 |
- <p className="header-info-id">{state.loginUser['user_name']}({state.loginUser['user_id']})</p> |
|
95 |
+ <p className="header-info-id"> |
|
96 |
+ {state.loginUser['user_name']}({state.loginUser['user_id']}) |
|
97 |
+ </p> |
|
48 | 98 |
</div> |
49 | 99 |
<Weather /> |
50 | 100 |
</div> |
--- client/views/pages/healthcare/Healthcare.jsx
+++ client/views/pages/healthcare/Healthcare.jsx
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 |
|
16 | 16 |
//전역 변수 저장 객체 |
17 | 17 |
const state = useSelector((state) => { return state }); |
18 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
18 | 19 |
|
19 | 20 |
//검색(엔터) |
20 | 21 |
const searchingEnter = (key) => { |
... | ... | @@ -119,6 +120,7 @@ |
119 | 120 |
for (let i = data.length - 1; i >= data.length - 3; i--) { |
120 | 121 |
let sum = 0; // 실제 복약량 |
121 | 122 |
let counter = 0; // 복약해야하는 양 |
123 |
+ let percent = 0; |
|
122 | 124 |
let chartData = { |
123 | 125 |
xName: data[i]['medication_default_date'] |
124 | 126 |
}; |
... | ... | @@ -133,7 +135,8 @@ |
133 | 135 |
continue; |
134 | 136 |
} |
135 | 137 |
} |
136 |
- _stackChartData.push({ "sum": sum, "total": counter }) |
|
138 |
+ percent = sum / counter; |
|
139 |
+ _stackChartData.push({ "sum": sum, "total": counter, "percent": percent }) |
|
137 | 140 |
} |
138 | 141 |
seniorNum.seniorMedicationList = _stackChartData; |
139 | 142 |
} |
... | ... | @@ -157,7 +160,6 @@ |
157 | 160 |
}, |
158 | 161 |
body: JSON.stringify(seniorNum), |
159 | 162 |
}).then((response) => response.json()).then((data) => { |
160 |
- console.log("seniorTemperatureListByDay data : ", data); |
|
161 | 163 |
setSeniorTemperatureListByDay(data); |
162 | 164 |
|
163 | 165 |
if (CommonUtil.isEmpty(data) == false) { |
... | ... | @@ -178,7 +180,6 @@ |
178 | 180 |
} |
179 | 181 |
|
180 | 182 |
seniorNum.seniorTemperatureList = _stackTemperatureData; |
181 |
- console.log('_stackTemperatureData : ', _stackTemperatureData); |
|
182 | 183 |
} |
183 | 184 |
}).catch((error) => { |
184 | 185 |
console.log('seniorTemperatureSelectListByDay() /user/seniorTemperatureSelectListByDay.json error : ', error); |
... | ... | @@ -198,13 +199,11 @@ |
198 | 199 |
} |
199 | 200 |
} |
200 | 201 |
|
201 |
- console.log(">>", seniorTemperature) |
|
202 |
- |
|
203 | 202 |
if (seniorTemperature.length > 0) { |
204 | 203 |
return ( |
205 | 204 |
seniorTemperature.map((item, idx) => { |
206 | 205 |
return ( |
207 |
- <td>{item}</td> |
|
206 |
+ <td className={riskStandard['risk_standard_start_value'] <= item || riskStandard['risk_standard_end_value'] >= item ? "red" : null}>{item}</td> |
|
208 | 207 |
) |
209 | 208 |
}) |
210 | 209 |
) |
... | ... | @@ -215,7 +214,30 @@ |
215 | 214 |
} |
216 | 215 |
} |
217 | 216 |
|
217 |
+ //위험 기준 목록 정보 |
|
218 |
+ const [riskStandard, setRiskStandard] = React.useState([]); |
|
219 |
+ //위험 기준 목록 조회 |
|
220 |
+ const riskStandardSelectList = () => { |
|
221 |
+ fetch("/danger/riskStandardSelectList.json", { |
|
222 |
+ method: "POST", |
|
223 |
+ headers: { |
|
224 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
225 |
+ }, |
|
226 |
+ body: JSON.stringify({ government_id: defaultGovernmentId }), |
|
227 |
+ }).then((response) => response.json()).then((data) => { |
|
228 |
+ console.log("위험 기준 목록 조회 결과(건수) : ", data); |
|
229 |
+ data.map((item, idx) => { |
|
230 |
+ if (item['risk_standard_type'] = "TEMP") { |
|
231 |
+ setRiskStandard(item); |
|
232 |
+ } |
|
233 |
+ }) |
|
234 |
+ }).catch((error) => { |
|
235 |
+ console.log('riskStandardSelectList() /danger/riskStandardSelectList.json error : ', error); |
|
236 |
+ }); |
|
237 |
+ } |
|
238 |
+ |
|
218 | 239 |
React.useEffect(() => { |
240 |
+ riskStandardSelectList(); |
|
219 | 241 |
searching(); |
220 | 242 |
}, []); |
221 | 243 |
|
... | ... | @@ -268,7 +290,7 @@ |
268 | 290 |
item['seniorMedicationList'] && item['seniorMedicationList'].length > 0 ? |
269 | 291 |
item['seniorMedicationList'].map((date, dataIdx) => { |
270 | 292 |
return ( |
271 |
- <td data-label="최근복약률"> |
|
293 |
+ <td data-label="최근복약률" className={date['percent'] < 0.5 ? "red" : null}> |
|
272 | 294 |
{date['sum']}/{date['total']} |
273 | 295 |
</td> |
274 | 296 |
) |
--- client/views/pages/healthcare/HealthcareAdmin.jsx
+++ client/views/pages/healthcare/HealthcareAdmin.jsx
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 |
|
16 | 16 |
//전역 변수 저장 객체 |
17 | 17 |
const state = useSelector((state) => { return state }); |
18 |
+ const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id']; |
|
18 | 19 |
|
19 | 20 |
//검색(엔터) |
20 | 21 |
const searchingEnter = (key) => { |
... | ... | @@ -119,6 +120,7 @@ |
119 | 120 |
for (let i = data.length - 1; i >= data.length - 3; i--) { |
120 | 121 |
let sum = 0; // 실제 복약량 |
121 | 122 |
let counter = 0; // 복약해야하는 양 |
123 |
+ let percent = 0; |
|
122 | 124 |
let chartData = { |
123 | 125 |
xName: data[i]['medication_default_date'] |
124 | 126 |
}; |
... | ... | @@ -133,7 +135,8 @@ |
133 | 135 |
continue; |
134 | 136 |
} |
135 | 137 |
} |
136 |
- _stackChartData.push({ "sum": sum, "total": counter }) |
|
138 |
+ percent = sum / counter; |
|
139 |
+ _stackChartData.push({ "sum": sum, "total": counter, "percent": percent }) |
|
137 | 140 |
} |
138 | 141 |
seniorNum.seniorMedicationList = _stackChartData; |
139 | 142 |
} |
... | ... | @@ -157,7 +160,6 @@ |
157 | 160 |
}, |
158 | 161 |
body: JSON.stringify(seniorNum), |
159 | 162 |
}).then((response) => response.json()).then((data) => { |
160 |
- console.log("seniorTemperatureListByDay data : ", data); |
|
161 | 163 |
setSeniorTemperatureListByDay(data); |
162 | 164 |
|
163 | 165 |
if (CommonUtil.isEmpty(data) == false) { |
... | ... | @@ -178,14 +180,13 @@ |
178 | 180 |
} |
179 | 181 |
|
180 | 182 |
seniorNum.seniorTemperatureList = _stackTemperatureData; |
181 |
- console.log('_stackTemperatureData : ', _stackTemperatureData); |
|
182 | 183 |
} |
183 | 184 |
}).catch((error) => { |
184 | 185 |
console.log('seniorTemperatureSelectListByDay() /user/seniorTemperatureSelectListByDay.json error : ', error); |
185 | 186 |
}); |
186 | 187 |
}; |
187 | 188 |
|
188 |
- const Temperature = ({data}) => { |
|
189 |
+ const Temperature = ({ data }) => { |
|
189 | 190 |
let seniorTemperature = []; |
190 | 191 |
if (data['seniorTemperatureList'] && data['seniorTemperatureList'].length > 0) { |
191 | 192 |
data['seniorTemperatureList'].map((data, dataIdx) => { |
... | ... | @@ -198,13 +199,11 @@ |
198 | 199 |
} |
199 | 200 |
} |
200 | 201 |
|
201 |
- console.log(">>", seniorTemperature) |
|
202 |
- |
|
203 | 202 |
if (seniorTemperature.length > 0) { |
204 | 203 |
return ( |
205 | 204 |
seniorTemperature.map((item, idx) => { |
206 | 205 |
return ( |
207 |
- <td>{item}</td> |
|
206 |
+ <td className={riskStandard['risk_standard_start_value'] <= item || riskStandard['risk_standard_end_value'] >= item ? "red" : null}>{item}</td> |
|
208 | 207 |
) |
209 | 208 |
}) |
210 | 209 |
) |
... | ... | @@ -215,7 +214,30 @@ |
215 | 214 |
} |
216 | 215 |
} |
217 | 216 |
|
217 |
+ //위험 기준 목록 정보 |
|
218 |
+ const [riskStandard, setRiskStandard] = React.useState([]); |
|
219 |
+ //위험 기준 목록 조회 |
|
220 |
+ const riskStandardSelectList = () => { |
|
221 |
+ fetch("/danger/riskStandardSelectList.json", { |
|
222 |
+ method: "POST", |
|
223 |
+ headers: { |
|
224 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
225 |
+ }, |
|
226 |
+ body: JSON.stringify({ government_id: defaultGovernmentId }), |
|
227 |
+ }).then((response) => response.json()).then((data) => { |
|
228 |
+ console.log("위험 기준 목록 조회 결과(건수) : ", data); |
|
229 |
+ data.map((item, idx) => { |
|
230 |
+ if (item['risk_standard_type'] = "TEMP") { |
|
231 |
+ setRiskStandard(item); |
|
232 |
+ } |
|
233 |
+ }) |
|
234 |
+ }).catch((error) => { |
|
235 |
+ console.log('riskStandardSelectList() /danger/riskStandardSelectList.json error : ', error); |
|
236 |
+ }); |
|
237 |
+ } |
|
238 |
+ |
|
218 | 239 |
React.useEffect(() => { |
240 |
+ riskStandardSelectList(); |
|
219 | 241 |
searching(); |
220 | 242 |
}, []); |
221 | 243 |
|
... | ... | @@ -268,7 +290,7 @@ |
268 | 290 |
item['seniorMedicationList'] && item['seniorMedicationList'].length > 0 ? |
269 | 291 |
item['seniorMedicationList'].map((date, dataIdx) => { |
270 | 292 |
return ( |
271 |
- <td data-label="최근복약률"> |
|
293 |
+ <td data-label="최근복약률" className={date['percent'] < 0.5 ? "red" : null}> |
|
272 | 294 |
{date['sum']}/{date['total']} |
273 | 295 |
</td> |
274 | 296 |
) |
--- client/views/pages/healthcare/HealthcareSelectOne.jsx
+++ client/views/pages/healthcare/HealthcareSelectOne.jsx
... | ... | @@ -393,33 +393,36 @@ |
393 | 393 |
|
394 | 394 |
|
395 | 395 |
const DateMedication = () => { |
396 |
- var clickDayMedication = []; |
|
396 |
+ var clickDayMedication = {}; |
|
397 |
+ var clcikDaymedicationCount = 0; |
|
397 | 398 |
medicationData.map((item, idx) => { |
398 | 399 |
if (item['xName'] === visitDate) { |
399 | 400 |
seniorMedicationList.map((time, idx) => { |
400 |
- clickDayMedication.push(item[time]); |
|
401 |
+ clickDayMedication[time] = item[time]; |
|
402 |
+ clcikDaymedicationCount += item[time]; |
|
401 | 403 |
}) |
402 | 404 |
} |
403 | 405 |
}) |
406 |
+ var keys = Object.keys(clickDayMedication); |
|
404 | 407 |
return ( |
405 | 408 |
<> |
406 | 409 |
<tr> |
407 | 410 |
<th rowSpan={2}>복약량</th> |
408 |
- {seniorMedicationList.map((item, idx) => { |
|
409 |
- return ( |
|
410 |
- <th> |
|
411 |
- {item == 'DAWN' ? '식전' : item == 'MORNING' ? '아침' : item == 'AFTERNOON' ? '점심' : item == 'NIGHT' ? '저녁' : item == 'MIDNIGHT' ? '취침' : null} |
|
412 |
- </th> |
|
413 |
- ) |
|
414 |
- })} |
|
411 |
+ {'DAWN' in clickDayMedication ? <th>식전</th> : null} |
|
412 |
+ {'MORNING' in clickDayMedication ? <th>아침</th> : null} |
|
413 |
+ {'AFTERNOON' in clickDayMedication ? <th>점심</th> : null} |
|
414 |
+ {'NIGHT' in clickDayMedication ? <th>저녁</th> : null} |
|
415 |
+ {'MIDNIGHT' in clickDayMedication ? <th>취침</th> : null} |
|
415 | 416 |
</tr> |
416 | 417 |
<tr> |
417 |
- {clickDayMedication.length > 0 ? ( |
|
418 |
- clickDayMedication.map((item) => { |
|
419 |
- return ( |
|
420 |
- <td>{item}</td> |
|
421 |
- ) |
|
422 |
- }) |
|
418 |
+ {clcikDaymedicationCount > 0 ? ( |
|
419 |
+ <> |
|
420 |
+ {'DAWN' in clickDayMedication ? <td>{clickDayMedication['DAWN']}</td> : null} |
|
421 |
+ {'MORNING' in clickDayMedication ? <td>{clickDayMedication['MORNING']}</td> : null} |
|
422 |
+ {'AFTERNOON' in clickDayMedication ? <td>{clickDayMedication['AFTERNOON']}</td> : null} |
|
423 |
+ {'NIGHT' in clickDayMedication ? <td>{clickDayMedication['NIGHT']}</td> : null} |
|
424 |
+ {'MIDNIGHT' in clickDayMedication ? <td>{clickDayMedication['MIDNIGHT']}</td> : null} |
|
425 |
+ </> |
|
423 | 426 |
) : <td colSpan={seniorMedicationList.length}>정보가 없습니다.</td>} |
424 | 427 |
</tr> |
425 | 428 |
</> |
--- client/views/pages/main/Main.jsx
+++ client/views/pages/main/Main.jsx
... | ... | @@ -20,161 +20,161 @@ |
20 | 20 |
import CommonUtil from "../../../resources/js/CommonUtil.js"; |
21 | 21 |
|
22 | 22 |
export default function Main() { |
23 |
- |
|
24 |
- |
|
25 |
- //관리자 메인 페이지 장비 통계 데이터 |
|
26 |
- const [adminMainEquipment, setAdminMainEquipment] = React.useState({ |
|
27 |
- today: CommonUtil.getDate(), |
|
28 |
- newEquipmentInquiryCount: 0, |
|
29 |
- newEquipmentCount: 0, |
|
30 |
- stockEquipmentCount: 0, |
|
31 |
- deliveryEquipmentCount: 0, |
|
23 |
+ //관리자 메인 페이지 장비 통계 데이터 |
|
24 |
+ const [adminMainEquipment, setAdminMainEquipment] = React.useState({ |
|
25 |
+ today: CommonUtil.getDate(), |
|
26 |
+ newEquipmentInquiryCount: 0, |
|
27 |
+ newEquipmentCount: 0, |
|
28 |
+ stockEquipmentCount: 0, |
|
29 |
+ deliveryEquipmentCount: 0, |
|
30 |
+ }); |
|
31 |
+ //관리자 메인 페이지 장비 통계 데이터 조회 |
|
32 |
+ const adminMainEquipmentSelect = () => { |
|
33 |
+ fetch("/equipment/adminMainEquipmentSelect.json", { |
|
34 |
+ method: "POST", |
|
35 |
+ headers: { |
|
36 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
37 |
+ }, |
|
38 |
+ body: JSON.stringify({}), |
|
39 |
+ }).then((response) => response.json()).then((data) => { |
|
40 |
+ console.log("관리자 메인 페이지 장비 통계 데이터 조회 : ", data); |
|
41 |
+ setAdminMainEquipment(data); |
|
42 |
+ }).catch((error) => { |
|
43 |
+ console.log('adminMainEquipmentSelect() /equipment/adminMainEquipmentSelect.json error : ', error); |
|
32 | 44 |
}); |
33 |
- //관리자 메인 페이지 장비 통계 데이터 조회 |
|
34 |
- const adminMainEquipmentSelect = () => { |
|
35 |
- fetch("/equipment/adminMainEquipmentSelect.json", { |
|
36 |
- method: "POST", |
|
37 |
- headers: { |
|
38 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
39 |
- }, |
|
40 |
- body: JSON.stringify({}), |
|
41 |
- }).then((response) => response.json()).then((data) => { |
|
42 |
- console.log("관리자 메인 페이지 장비 통계 데이터 조회 : ", data); |
|
43 |
- setAdminMainEquipment(data); |
|
44 |
- }).catch((error) => { |
|
45 |
- console.log('adminMainEquipmentSelect() /equipment/adminMainEquipmentSelect.json error : ', error); |
|
46 |
- }); |
|
47 |
- }; |
|
45 |
+ }; |
|
48 | 46 |
|
49 |
- //달력에 색칠할 날짜 목록 ex) ['2023-04-17', '2023-05-17', ...] |
|
50 |
- const [selectDate, setSelectDate] = React.useState(adminMainEquipment.today); |
|
51 |
- //달력에 색칠할 날짜 목록 ex) ['2023-04-17', '2023-05-17', ...] |
|
52 |
- const [markList, setMarkList] = React.useState([]); |
|
53 |
- //관리자 메인 페이지 장비 통계 데이터 |
|
54 |
- const [equipmentCountByEventInMonth, setEquipmentCountByEventInMonth] = React.useState([]); |
|
55 |
- //관리자 메인 페이지 장비 통계 데이터 조회 |
|
56 |
- const getEquipmentCountByEventInMonth = (date) => { |
|
57 |
- console.log('getEquipmentCountByEventInMonth date : ', date); |
|
58 |
- fetch("/equipment/equipmentCountByEventInMonth.json", { |
|
59 |
- method: "POST", |
|
60 |
- headers: { |
|
61 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
62 |
- }, |
|
63 |
- body: JSON.stringify({'date': date}), |
|
64 |
- }).then((response) => response.json()).then((data) => { |
|
65 |
- console.log("관리자 메인 페이지 장비 통계 데이터 조회 : ", data); |
|
66 |
- setEquipmentCountByEventInMonth(data); |
|
67 |
- |
|
68 |
- let newMarkList = []; |
|
69 |
- for (let i = 0; i < data.length; i++) { |
|
70 |
- const result = data[i]['new_equipment_inquiry_count'] + data[i]['new_equipment_count'] + data[i]['delivery_equipment_count']; |
|
71 |
- if (result > 0) { |
|
72 |
- newMarkList.push(data[i]['date']) |
|
73 |
- } else { |
|
74 |
- continue; |
|
75 |
- } |
|
76 |
- } |
|
77 |
- console.log('newMarkList : ', newMarkList); |
|
78 |
- setMarkList(newMarkList); |
|
79 |
- }).catch((error) => { |
|
80 |
- console.log('getEquipmentCountByEventInMonth() /equipment/equipmentCountByEventInMonth.json error : ', error); |
|
81 |
- }); |
|
82 |
- }; |
|
47 |
+ //달력에 색칠할 날짜 목록 ex) ['2023-04-17', '2023-05-17', ...] |
|
48 |
+ const [selectDate, setSelectDate] = React.useState(adminMainEquipment.today); |
|
49 |
+ //달력에 색칠할 날짜 목록 ex) ['2023-04-17', '2023-05-17', ...] |
|
50 |
+ const [markList, setMarkList] = React.useState([]); |
|
51 |
+ //관리자 메인 페이지 장비 통계 데이터 |
|
52 |
+ const [equipmentCountByEventInMonth, setEquipmentCountByEventInMonth] = React.useState([]); |
|
53 |
+ //관리자 메인 페이지 장비 통계 데이터 조회 |
|
54 |
+ const getEquipmentCountByEventInMonth = (date) => { |
|
55 |
+ console.log('getEquipmentCountByEventInMonth date : ', date); |
|
56 |
+ fetch("/equipment/equipmentCountByEventInMonth.json", { |
|
57 |
+ method: "POST", |
|
58 |
+ headers: { |
|
59 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
60 |
+ }, |
|
61 |
+ body: JSON.stringify({ 'date': date }), |
|
62 |
+ }).then((response) => response.json()).then((data) => { |
|
63 |
+ console.log("관리자 메인 페이지 장비 통계 데이터 조회 : ", data); |
|
64 |
+ setEquipmentCountByEventInMonth(data); |
|
83 | 65 |
|
84 |
- |
|
66 |
+ let newMarkList = []; |
|
67 |
+ for (let i = 0; i < data.length; i++) { |
|
68 |
+ const result = data[i]['new_equipment_inquiry_count'] + data[i]['new_equipment_count'] + data[i]['delivery_equipment_count']; |
|
69 |
+ if (result > 0) { |
|
70 |
+ newMarkList.push(data[i]['date']) |
|
71 |
+ } else { |
|
72 |
+ continue; |
|
73 |
+ } |
|
74 |
+ } |
|
75 |
+ console.log('newMarkList : ', newMarkList); |
|
76 |
+ setMarkList(newMarkList); |
|
77 |
+ }).catch((error) => { |
|
78 |
+ console.log('getEquipmentCountByEventInMonth() /equipment/equipmentCountByEventInMonth.json error : ', error); |
|
79 |
+ }); |
|
80 |
+ }; |
|
85 | 81 |
|
86 | 82 |
|
87 |
- React.useEffect(() => { |
|
88 |
- adminMainEquipmentSelect(); |
|
89 |
- getEquipmentCountByEventInMonth(); |
|
90 |
- }, []); |
|
91 | 83 |
|
92 | 84 |
|
93 |
- return ( |
|
94 |
- <main> |
|
95 |
- <div className="flex-start margin-bottom2"> |
|
96 |
- <img src={tool} alt="" /> |
|
97 |
- <TitleSmall title={"장비 및 업체 현황"} explanation={adminMainEquipment.today} /> |
|
85 |
+ React.useEffect(() => { |
|
86 |
+ adminMainEquipmentSelect(); |
|
87 |
+ getEquipmentCountByEventInMonth(); |
|
88 |
+ }, []); |
|
89 |
+ |
|
90 |
+ |
|
91 |
+ return ( |
|
92 |
+ <main> |
|
93 |
+ <div className="flex-start margin-bottom2"> |
|
94 |
+ <img src={tool} alt="" /> |
|
95 |
+ <TitleSmall title={"장비 및 업체 현황"} explanation={adminMainEquipment.today} /> |
|
96 |
+ </div> |
|
97 |
+ <div className="main-grid-admin margin-bottom2"> |
|
98 |
+ <ul className="content-box statistics-agency" background="#5f9af3"> |
|
99 |
+ <li className="flex-start"> |
|
100 |
+ <img src={error} alt="" /> |
|
101 |
+ <div className="text"> |
|
102 |
+ <p>답변 대기 문의 수</p> |
|
103 |
+ <p className="equipcount">{adminMainEquipment.newEquipmentInquiryCount}</p> |
|
98 | 104 |
</div> |
99 |
- <div className="main-grid-admin margin-bottom2"> |
|
100 |
- <ul className="content-box statistics-agency" background="#5f9af3"> |
|
101 |
- <li className="flex-start"> |
|
102 |
- <img src={error} alt="" /> |
|
103 |
- <div className="text"> |
|
104 |
- <p>답변 대기 문의 수</p> |
|
105 |
- <p className="equipcount">{adminMainEquipment.newEquipmentInquiryCount}</p> |
|
106 |
- </div> |
|
107 |
- </li> |
|
108 |
- </ul> |
|
109 |
- <ul className="content-box statistics-agency" background="#f7acba"> |
|
110 |
- <li className="flex-start"> |
|
111 |
- <img src={box} alt="" /> |
|
112 |
- <div className="text"> |
|
113 |
- <p>신규 장비 수</p> |
|
114 |
- <p className="equipcount">{adminMainEquipment.newEquipmentCount}</p> |
|
115 |
- </div> |
|
116 |
- </li> |
|
117 |
- </ul> |
|
118 |
- <ul className="content-box statistics-agency" background="#ebe7b9" > |
|
119 |
- <li className="flex-start"> |
|
120 |
- <img src={exchange} alt="" /> |
|
121 |
- <div className="text"> |
|
122 |
- <p>재고 장비 수</p> |
|
123 |
- <p className="equipcount">{adminMainEquipment.stockEquipmentCount}</p> |
|
124 |
- </div> |
|
125 |
- </li> |
|
126 |
- </ul> |
|
127 |
- <ul className="content-box statistics-agency" background="#8ef3d1"> |
|
128 |
- <li className="flex-start"> |
|
129 |
- <img src={error} alt="" /> |
|
130 |
- <div className="text"> |
|
131 |
- <p>납품 장비 수</p> |
|
132 |
- <p className="equipcount">{adminMainEquipment.deliveryEquipmentCount}</p> |
|
133 |
- </div> |
|
134 |
- </li> |
|
135 |
- </ul> |
|
105 |
+ </li> |
|
106 |
+ </ul> |
|
107 |
+ <ul className="content-box statistics-agency" background="#f7acba"> |
|
108 |
+ <li className="flex-start"> |
|
109 |
+ <img src={box} alt="" /> |
|
110 |
+ <div className="text"> |
|
111 |
+ <p>신규 장비 수</p> |
|
112 |
+ <p className="equipcount">{adminMainEquipment.newEquipmentCount}</p> |
|
113 |
+ </div> |
|
114 |
+ </li> |
|
115 |
+ </ul> |
|
116 |
+ <ul className="content-box statistics-agency" background="#ebe7b9" > |
|
117 |
+ <li className="flex-start"> |
|
118 |
+ <img src={exchange} alt="" /> |
|
119 |
+ <div className="text"> |
|
120 |
+ <p>재고 장비 수</p> |
|
121 |
+ <p className="equipcount">{adminMainEquipment.stockEquipmentCount}</p> |
|
122 |
+ </div> |
|
123 |
+ </li> |
|
124 |
+ </ul> |
|
125 |
+ <ul className="content-box statistics-agency" background="#8ef3d1"> |
|
126 |
+ <li className="flex-start"> |
|
127 |
+ <img src={error} alt="" /> |
|
128 |
+ <div className="text"> |
|
129 |
+ <p>납품 장비 수</p> |
|
130 |
+ <p className="equipcount">{adminMainEquipment.deliveryEquipmentCount}</p> |
|
131 |
+ </div> |
|
132 |
+ </li> |
|
133 |
+ </ul> |
|
134 |
+ </div> |
|
135 |
+ |
|
136 |
+ <div className="main-grid-admin"> |
|
137 |
+ <div className="content-box combine-left-government3"> |
|
138 |
+ <div> |
|
139 |
+ <div className="margin-bottom2"> |
|
140 |
+ <Calendar_agency |
|
141 |
+ onClick={(date) => { setSelectDate(date); console.log('onclick callback value : ', date) }} |
|
142 |
+ setDate={getEquipmentCountByEventInMonth} |
|
143 |
+ markList={markList} |
|
144 |
+ /> |
|
136 | 145 |
</div> |
137 | 146 |
|
138 |
- <div className="main-grid-admin"> |
|
139 |
- <div className="content-box combine-left-government3"> |
|
140 |
- <div> |
|
141 |
- <div className="margin-bottom2"> |
|
142 |
- <Calendar_agency |
|
143 |
- onClick={(date) => {setSelectDate(date);console.log('onclick callback value : ', date)}} |
|
144 |
- setDate={getEquipmentCountByEventInMonth} |
|
145 |
- markList={markList} |
|
146 |
- /> |
|
147 |
- </div> |
|
147 |
+ <table className={"agency-visitlist"}> |
|
148 |
+ <thead> |
|
149 |
+ <tr> |
|
150 |
+ <th>일자</th> |
|
151 |
+ <th>신규 문의 수</th> |
|
152 |
+ <th>신규 장비 수</th> |
|
153 |
+ <th>납품 장비 수</th> |
|
154 |
+ </tr> |
|
155 |
+ </thead> |
|
156 |
+ <tbody> |
|
157 |
+ {equipmentCountByEventInMonth.map((item, idx) => { |
|
158 |
+ return ( |
|
159 |
+ <tr className={item['date'] == selectDate ? 'active' : null}> |
|
160 |
+ <td>{item['date']}</td> |
|
161 |
+ <td>{item['new_equipment_inquiry_count'] == 0 ? '-' : item['new_equipment_inquiry_count']}</td> |
|
162 |
+ <td>{item['new_equipment_count'] == 0 ? '-' : item['new_equipment_count']}</td> |
|
163 |
+ <td>{item['delivery_equipment_count'] == 0 ? '-' : item['delivery_equipment_count']}</td> |
|
164 |
+ </tr> |
|
165 |
+ ) |
|
166 |
+ })} |
|
167 |
+ {CommonUtil.isEmpty(equipmentCountByEventInMonth) ? |
|
168 |
+ <tr> |
|
169 |
+ <td colSpan={4}>조회된 데이터가 없습니다</td> |
|
170 |
+ </tr> |
|
171 |
+ : null} |
|
172 |
+ </tbody> |
|
173 |
+ </table> |
|
148 | 174 |
|
149 |
- <table className={"agency-visitlist"}> |
|
150 |
- <thead> |
|
151 |
- <tr> |
|
152 |
- <th>일자</th> |
|
153 |
- <th>신규 문의 수</th> |
|
154 |
- <th>신규 장비 수</th> |
|
155 |
- <th>납품 장비 수</th> |
|
156 |
- </tr> |
|
157 |
- </thead> |
|
158 |
- <tbody> |
|
159 |
- {equipmentCountByEventInMonth.map((item, idx) => {return ( |
|
160 |
- <tr className={item['date'] == selectDate ? 'active': null}> |
|
161 |
- <td>{item['date']}</td> |
|
162 |
- <td>{item['new_equipment_inquiry_count'] == 0 ? '-' : item['new_equipment_inquiry_count']}</td> |
|
163 |
- <td>{item['new_equipment_count'] == 0 ? '-' : item['new_equipment_count']}</td> |
|
164 |
- <td>{item['delivery_equipment_count'] == 0 ? '-' : item['delivery_equipment_count']}</td> |
|
165 |
- </tr> |
|
166 |
- )})} |
|
167 |
- {CommonUtil.isEmpty(equipmentCountByEventInMonth) ? |
|
168 |
- <tr> |
|
169 |
- <td colSpan={4}>조회된 데이터가 없습니다</td> |
|
170 |
- </tr> |
|
171 |
- : null} |
|
172 |
- </tbody> |
|
173 |
- </table> |
|
174 |
- |
|
175 |
- </div> |
|
176 |
- </div> |
|
177 |
- </div> |
|
178 |
- </main> |
|
179 |
- ); |
|
175 |
+ </div> |
|
176 |
+ </div> |
|
177 |
+ </div> |
|
178 |
+ </main> |
|
179 |
+ ); |
|
180 | 180 |
} |
--- client/views/pages/main/Main_agency.jsx
+++ client/views/pages/main/Main_agency.jsx
... | ... | @@ -113,25 +113,6 @@ |
113 | 113 |
}); |
114 | 114 |
} |
115 | 115 |
|
116 |
- //전체 대상자(시니어) 수 조회 |
|
117 |
- const [seniorCount, setSeniorCount] = React.useState(0); |
|
118 |
- const agentSeniorCount = () => { |
|
119 |
- fetch("/stats/agentSeniorCount.json", { |
|
120 |
- method: "POST", |
|
121 |
- headers: { |
|
122 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
123 |
- }, |
|
124 |
- body: JSON.stringify({ |
|
125 |
- 'agent_id': state.loginUser['user_id'], |
|
126 |
- }), |
|
127 |
- }).then((response) => response.json()).then((data) => { |
|
128 |
- console.log("전체 대상자(시니어) 수 조회 : ", data); |
|
129 |
- setSeniorCount(data); |
|
130 |
- }).catch((error) => { |
|
131 |
- console.log('agentSeniorCount() /stats/agentSeniorCount.json error : ', error); |
|
132 |
- }); |
|
133 |
- } |
|
134 |
- |
|
135 | 116 |
//온도 위험 대상자(시니어) 수 조회 |
136 | 117 |
const [temperatureCount, setTemperatureCount] = React.useState(0); |
137 | 118 |
const temperatureRiskCount = () => { |
... | ... | @@ -179,7 +160,7 @@ |
179 | 160 |
headers: { |
180 | 161 |
'Content-Type': 'application/json; charset=UTF-8' |
181 | 162 |
}, |
182 |
- body: JSON.stringify({ "agency_id": state.loginUser['agency_id'] }), |
|
163 |
+ body: JSON.stringify({ "agent_id": state.loginUser['user_id'] }), |
|
183 | 164 |
}).then((response) => response.json()).then((data) => { |
184 | 165 |
console.log("seniorMedicationSelectListByNew : ", data); |
185 | 166 |
setMedicationSelectListByNew(data) |
... | ... | @@ -244,7 +225,6 @@ |
244 | 225 |
|
245 | 226 |
|
246 | 227 |
React.useEffect(() => { |
247 |
- agentSeniorCount(); |
|
248 | 228 |
temperatureRiskCount(); |
249 | 229 |
batteryRiskCount(); |
250 | 230 |
seniorMedicationSelectListByNew(); |
... | ... | @@ -256,15 +236,6 @@ |
256 | 236 |
<main> |
257 | 237 |
<div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"대상자 현황"} explanation={new Date(new Date().setDate(new Date().getDate() - 1)).toLocaleDateString().replace(/\./g, '').replace(/\s/g, '-') + " 기준"} /></div> |
258 | 238 |
<div className="main-grid-agency margin-bottom2"> |
259 |
- <ul className="content-box statistics-agency" background="#f7acba"> |
|
260 |
- <li className="flex-start"> |
|
261 |
- <img src={box} alt="" /> |
|
262 |
- <div className="text"> |
|
263 |
- <p>나의 돌봄 대상자</p> |
|
264 |
- <p className="peoplecount">{seniorCount}</p> |
|
265 |
- </div> |
|
266 |
- </li> |
|
267 |
- </ul> |
|
268 | 239 |
<ul className="content-box statistics-agency" background="#8ef3d1"> |
269 | 240 |
<li className="flex-start"> |
270 | 241 |
<img src={medicineAgency} alt="" /> |
... | ... | @@ -374,7 +345,7 @@ |
374 | 345 |
</div> */} |
375 | 346 |
<div className="main-grid-agency2"> |
376 | 347 |
<div> |
377 |
- <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"시니어 복약률 순위"} /></div> |
|
348 |
+ <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"시니어 복약수 순위"} /></div> |
|
378 | 349 |
<div className="content-box combine-left-government3 visitlist margin-bottom2"> |
379 | 350 |
{ |
380 | 351 |
medicationSelectListByNew.length > 0 ? |
--- client/views/pages/main/Main_agencyAdmin.jsx
+++ client/views/pages/main/Main_agencyAdmin.jsx
... | ... | @@ -57,25 +57,6 @@ |
57 | 57 |
}); |
58 | 58 |
} |
59 | 59 |
|
60 |
- //전체 대상자(시니어) 수 조회 |
|
61 |
- const [seniorCount, setSeniorCount] = React.useState(0); |
|
62 |
- const seniorCountTotal = () => { |
|
63 |
- fetch("/stats/agencySeniorCount.json", { |
|
64 |
- method: "POST", |
|
65 |
- headers: { |
|
66 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
67 |
- }, |
|
68 |
- body: JSON.stringify({ |
|
69 |
- 'agency_id': state.loginUser['agency_id'], |
|
70 |
- }), |
|
71 |
- }).then((response) => response.json()).then((data) => { |
|
72 |
- console.log("전체 대상자(시니어) 수 조회 : ", data); |
|
73 |
- setSeniorCount(data); |
|
74 |
- }).catch((error) => { |
|
75 |
- console.log('agencySeniorCount() /stats/agencySeniorCount.json error : ', error); |
|
76 |
- }); |
|
77 |
- } |
|
78 |
- |
|
79 | 60 |
//온도 위험 대상자(시니어) 수 조회 |
80 | 61 |
const [temperatureCount, setTemperatureCount] = React.useState(0); |
81 | 62 |
const temperatureRiskCount = () => { |
... | ... | @@ -238,7 +219,6 @@ |
238 | 219 |
|
239 | 220 |
React.useEffect(() => { |
240 | 221 |
seniorSelectList(); |
241 |
- seniorCountTotal(); |
|
242 | 222 |
temperatureRiskCount(); |
243 | 223 |
batteryRiskCount(); |
244 | 224 |
visitByMonthList(); |
... | ... | @@ -251,13 +231,6 @@ |
251 | 231 |
<main> |
252 | 232 |
<div className="main-grid-government"> |
253 | 233 |
<div className="sub-grid-government"> |
254 |
- <ul className="content-box statistics-govern" background="#f7acba"> |
|
255 |
- <li> |
|
256 |
- <p><ElderlyIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#bf0629", borderRadius: "50px" }} /></p> |
|
257 |
- <p>{cityName} 전체 대상자</p> |
|
258 |
- <p>{seniorCount}</p> |
|
259 |
- </li> |
|
260 |
- </ul> |
|
261 | 234 |
<ul className="content-box statistics-govern" background="#8ef3d1"> |
262 | 235 |
<li> |
263 | 236 |
<p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#076143", borderRadius: "50px" }} /></p> |
--- client/views/pages/main/Main_government.jsx
+++ client/views/pages/main/Main_government.jsx
... | ... | @@ -53,25 +53,6 @@ |
53 | 53 |
}); |
54 | 54 |
} |
55 | 55 |
|
56 |
- //전체 대상자(시니어) 수 조회 |
|
57 |
- const [seniorCount, setSeniorCount] = React.useState(0); |
|
58 |
- const seniorCountTotal = () => { |
|
59 |
- fetch("/stats/governmentSeniorCount.json", { |
|
60 |
- method: "POST", |
|
61 |
- headers: { |
|
62 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
63 |
- }, |
|
64 |
- body: JSON.stringify({ |
|
65 |
- 'government_id': state.loginUser['government_id'], |
|
66 |
- }), |
|
67 |
- }).then((response) => response.json()).then((data) => { |
|
68 |
- console.log("전체 대상자(시니어) 수 조회 : ", data); |
|
69 |
- setSeniorCount(data); |
|
70 |
- }).catch((error) => { |
|
71 |
- console.log('governmentSeniorCount() /stats/governmentSeniorCount.json error : ', error); |
|
72 |
- }); |
|
73 |
- } |
|
74 |
- |
|
75 | 56 |
//온도 위험 대상자(시니어) 수 조회 |
76 | 57 |
const [temperatureCount, setTemperatureCount] = React.useState(0); |
77 | 58 |
const temperatureRiskCount = () => { |
... | ... | @@ -271,7 +252,6 @@ |
271 | 252 |
|
272 | 253 |
React.useEffect(() => { |
273 | 254 |
seniorSelectList(); |
274 |
- seniorCountTotal(); |
|
275 | 255 |
temperatureRiskCount(); |
276 | 256 |
batteryRiskCount(); |
277 | 257 |
visitByMonthList(); |
... | ... | @@ -285,13 +265,6 @@ |
285 | 265 |
<main> |
286 | 266 |
<div className="main-grid-government"> |
287 | 267 |
<div className="sub-grid-government"> |
288 |
- <ul className="content-box statistics-govern" background="#f7acba"> |
|
289 |
- <li> |
|
290 |
- <p><ElderlyIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#bf0629", borderRadius: "50px" }} /></p> |
|
291 |
- <p>{cityName} 전체 대상자</p> |
|
292 |
- <p>{seniorCount}</p> |
|
293 |
- </li> |
|
294 |
- </ul> |
|
295 | 268 |
<ul className="content-box statistics-govern" background="#8ef3d1"> |
296 | 269 |
<li> |
297 | 270 |
<p><MedicationIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#076143", borderRadius: "50px" }} /></p> |
... | ... | @@ -303,7 +276,7 @@ |
303 | 276 |
<li> |
304 | 277 |
<p><DeviceThermostatIcon sx={{ width: "50px", height: "50px", color: "#ffffff", background: "#f1de05", borderRadius: "50px" }} /></p> |
305 | 278 |
<p>{cityName} 댁내 온도 위험 대상자</p> |
306 |
- <p>{temperatureCount}</p> |
|
279 |
+ <p className={temperatureCount > 0 ? "red" : null}>{temperatureCount}</p> |
|
307 | 280 |
</li> |
308 | 281 |
</ul> |
309 | 282 |
<ul className="content-box statistics-govern" background="#5f9af3"> |
--- client/views/pages/main/Main_guardian.jsx
+++ client/views/pages/main/Main_guardian.jsx
... | ... | @@ -289,33 +289,36 @@ |
289 | 289 |
|
290 | 290 |
|
291 | 291 |
const DateMedication = () => { |
292 |
- var clickDayMedication = []; |
|
292 |
+ var clickDayMedication = {}; |
|
293 |
+ var clcikDaymedicationCount = 0; |
|
293 | 294 |
medicationData.map((item, idx) => { |
294 | 295 |
if (item['xName'] === visitDate) { |
295 | 296 |
seniorMedicationList.map((time, idx) => { |
296 |
- clickDayMedication.push(item[time]); |
|
297 |
+ clickDayMedication[time] = item[time]; |
|
298 |
+ clcikDaymedicationCount += item[time]; |
|
297 | 299 |
}) |
298 | 300 |
} |
299 | 301 |
}) |
302 |
+ var keys = Object.keys(clickDayMedication); |
|
300 | 303 |
return ( |
301 | 304 |
<> |
302 | 305 |
<tr> |
303 | 306 |
<th rowSpan={2}>복약량</th> |
304 |
- {seniorMedicationList.map((item, idx) => { |
|
305 |
- return ( |
|
306 |
- <th> |
|
307 |
- {item == 'DAWN' ? '식전' : item == 'MORNING' ? '아침' : item == 'AFTERNOON' ? '점심' : item == 'NIGHT' ? '저녁' : item == 'MIDNIGHT' ? '취침' : null} |
|
308 |
- </th> |
|
309 |
- ) |
|
310 |
- })} |
|
307 |
+ {'DAWN' in clickDayMedication ? <th>식전</th> : null} |
|
308 |
+ {'MORNING' in clickDayMedication ? <th>아침</th> : null} |
|
309 |
+ {'AFTERNOON' in clickDayMedication ? <th>점심</th> : null} |
|
310 |
+ {'NIGHT' in clickDayMedication ? <th>저녁</th> : null} |
|
311 |
+ {'MIDNIGHT' in clickDayMedication ? <th>취침</th> : null} |
|
311 | 312 |
</tr> |
312 | 313 |
<tr> |
313 |
- {clickDayMedication.length > 0 ? ( |
|
314 |
- clickDayMedication.map((item) => { |
|
315 |
- return ( |
|
316 |
- <td>{item}</td> |
|
317 |
- ) |
|
318 |
- }) |
|
314 |
+ {clcikDaymedicationCount > 0 ? ( |
|
315 |
+ <> |
|
316 |
+ {'DAWN' in clickDayMedication ? <td>{clickDayMedication['DAWN']}</td> : null} |
|
317 |
+ {'MORNING' in clickDayMedication ? <td>{clickDayMedication['MORNING']}</td> : null} |
|
318 |
+ {'AFTERNOON' in clickDayMedication ? <td>{clickDayMedication['AFTERNOON']}</td> : null} |
|
319 |
+ {'NIGHT' in clickDayMedication ? <td>{clickDayMedication['NIGHT']}</td> : null} |
|
320 |
+ {'MIDNIGHT' in clickDayMedication ? <td>{clickDayMedication['MIDNIGHT']}</td> : null} |
|
321 |
+ </> |
|
319 | 322 |
) : <td colSpan={seniorMedicationList.length}>정보가 없습니다.</td>} |
320 | 323 |
</tr> |
321 | 324 |
</> |
--- client/views/pages/org/OrgSelect.jsx
+++ client/views/pages/org/OrgSelect.jsx
... | ... | @@ -249,7 +249,7 @@ |
249 | 249 |
} else { |
250 | 250 |
agency.agency = item; |
251 | 251 |
} |
252 |
- setAgency({...agency}); |
|
252 |
+ setAgency({ ...agency }); |
|
253 | 253 |
setIsAgencyModalOpen(true); |
254 | 254 |
}; |
255 | 255 |
//시행기관 모달 닫기 |
... | ... | @@ -698,15 +698,27 @@ |
698 | 698 |
{/* <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> */} |
699 | 699 |
<div className="btn-wrap flex-end margin-bottom "> |
700 | 700 |
{state.loginUser['authority'] == 'ROLE_ADMIN' || state.loginUser['authority'] == 'ROLE_GOVERNMENT' ? |
701 |
- <button className={"btn-small gray-btn"} onClick={() => { |
|
702 |
- agency.agency['agency_id'] = null; |
|
703 |
- if (CommonUtil.isEmpty(government.government['government_id']) == false) { |
|
704 |
- agency.agency['government_id'] = government.government['government_id']; |
|
705 |
- agency.agency['agency_type'] = government.government['government_type']; |
|
706 |
- } |
|
707 |
- setAgency({ ...agency }); |
|
708 |
- agencyModalOpen(); |
|
709 |
- }}>등록</button> |
|
701 |
+ <> |
|
702 |
+ {government.government['government_id'] != null ? |
|
703 |
+ <button className={"btn-small lightgray-btn"} |
|
704 |
+ onClick={() => { |
|
705 |
+ government.government = governmentInit; |
|
706 |
+ setGovernment({ ...government }); |
|
707 |
+ agency.search = { currentPage: 1, perPage: 5, 'government_id': agencyInit['government_id'], 'agency_id': agencyInit['agency_id'] } |
|
708 |
+ setAgency({ ...agency }); |
|
709 |
+ agencySelectList(); |
|
710 |
+ }}>전체보기</button> |
|
711 |
+ : null} |
|
712 |
+ <button className={"btn-small gray-btn"} onClick={() => { |
|
713 |
+ agency.agency['agency_id'] = null; |
|
714 |
+ if (CommonUtil.isEmpty(government.government['government_id']) == false) { |
|
715 |
+ agency.agency['government_id'] = government.government['government_id']; |
|
716 |
+ agency.agency['agency_type'] = government.government['government_type']; |
|
717 |
+ } |
|
718 |
+ setAgency({ ...agency }); |
|
719 |
+ agencyModalOpen(); |
|
720 |
+ }}>등록</button> |
|
721 |
+ </> |
|
710 | 722 |
: null} |
711 | 723 |
</div> |
712 | 724 |
<table className={"senior-user protector-user"}> |
--- client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
+++ client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
... | ... | @@ -197,6 +197,7 @@ |
197 | 197 |
}), |
198 | 198 |
}).then((response) => response.json()).then((data) => { |
199 | 199 |
closeModal(); |
200 |
+ setCheckList([]); |
|
200 | 201 |
agentSelectList(); |
201 | 202 |
searching(); |
202 | 203 |
}).catch((error) => { |
... | ... | @@ -404,7 +405,9 @@ |
404 | 405 |
} /> |
405 | 406 |
<div className="btn-wrap flex-end margin-bottom "> |
406 | 407 |
<button className={"btn-small gray-btn"} onClick={modalSeniorInsertOpen}>신규등록</button> |
407 |
- <button className={"btn-small gray-btn"} onClick={() => { openModal() }}>{state.loginUser['title_name']}배정</button> |
|
408 |
+ <button className={"btn-small gray-btn"} |
|
409 |
+ onClick={() => { CheckList.length > 0 ? openModal() : alert('담당자를 배정할 시니어를 선택해 주세요.') }} |
|
410 |
+ >{state.loginUser['title_name']}배정</button> |
|
408 | 411 |
</div> |
409 | 412 |
</div> |
410 | 413 |
<table className={"protector-user"}> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?