
--- client/resources/css/common.css
+++ client/resources/css/common.css
... | ... | @@ -1,6 +1,8 @@ |
1 | 1 |
|
2 | 2 |
/* layout 공통 */ |
3 | 3 |
textarea{border: 1px solid #d8d3c7; border-radius: 5px;} |
4 |
+em{font-style: normal;} |
|
5 |
+main img{margin-right: 1rem;} |
|
4 | 6 |
/* grid */ |
5 | 7 |
|
6 | 8 |
.main-grid-admin { |
... | ... | @@ -45,7 +47,7 @@ |
45 | 47 |
display: grid; |
46 | 48 |
grid-template-columns: 0.9fr 0.9fr; |
47 | 49 |
grid-template-rows: 0.1fr 0.5fr 0.5fr; |
48 |
- gap: 1rem; |
|
50 |
+ gap: 2rem; |
|
49 | 51 |
} |
50 | 52 |
|
51 | 53 |
.statistics-grid { |
--- client/resources/css/main.css
+++ client/resources/css/main.css
... | ... | @@ -11,7 +11,6 @@ |
11 | 11 |
.join-btn{ |
12 | 12 |
background-color: transparent; |
13 | 13 |
} |
14 |
-.react-calendar{width: 90%; } |
|
15 | 14 |
.highlight{ |
16 | 15 |
font-weight: 900; |
17 | 16 |
background-color: #18924e; |
... | ... | @@ -20,7 +19,6 @@ |
20 | 19 |
/* 기관조회 */ |
21 | 20 |
|
22 | 21 |
/* Q&A */ |
23 |
-.title{text-decoration: underline; cursor: pointer;} |
|
24 | 22 |
.question-select input{width: 3%;} |
25 | 23 |
.question-select label{width: 10%;} |
26 | 24 |
.question-select select{width: 16%; height: 3.7rem;} |
... | ... | @@ -41,7 +39,6 @@ |
41 | 39 |
.questionnaire-table input{width: 9%;} |
42 | 40 |
/* 카테고리 기관 추가*/ |
43 | 41 |
.explain-table th{background: #ffffff;} |
44 |
-.react-calendar{width: 100%;} |
|
45 | 42 |
.total p{font-size: 1.6rem; font-weight: 600;} |
46 | 43 |
.total{color: #733c1d; } |
47 | 44 |
.total-equip::before{ |
... | ... | @@ -171,14 +168,15 @@ |
171 | 168 |
content: "명"; |
172 | 169 |
} |
173 | 170 |
.statistics-guardian{height: 100%;} |
171 |
+.guardian-medicine{height: 16vh;} |
|
174 | 172 |
.statistics-guardian li{ |
175 | 173 |
padding: 1rem 3rem; |
176 |
- background: rgba(255, 254, 254, 0.5); |
|
177 |
- border-radius: 10px; |
|
174 |
+ background: #ffffff; |
|
175 |
+ border-radius: 20px; |
|
178 | 176 |
margin: 0 auto; |
179 | 177 |
margin-bottom: 1rem; |
180 | 178 |
} |
181 |
-.statistics-guardian:nth-child(1) { |
|
179 |
+/* .statistics-guardian:nth-child(1) { |
|
182 | 180 |
background: #fbe4e4; |
183 | 181 |
} |
184 | 182 |
|
... | ... | @@ -195,7 +193,7 @@ |
195 | 193 |
} |
196 | 194 |
.statistics-guardian li p{ |
197 | 195 |
padding: 0 2rem; |
198 |
-} |
|
196 |
+} */ |
|
199 | 197 |
.statistics-guardian li:nth-child(2), |
200 | 198 |
.statistics-guardian li:nth-child(3), |
201 | 199 |
.statistics-guardian li:nth-child(4), |
... | ... | @@ -300,6 +298,7 @@ |
300 | 298 |
font-weight: bold; |
301 | 299 |
margin-right: 2rem; |
302 | 300 |
} |
301 |
+.main-guardian{margin-bottom: 3rem;} |
|
303 | 302 |
.red{color: red;} |
304 | 303 |
.main-battery-title span::after { |
305 | 304 |
content: " 님의"; |
... | ... | @@ -312,6 +311,10 @@ |
312 | 311 |
font-weight: 900; |
313 | 312 |
} |
314 | 313 |
.main-battery-title p{padding-right: 1rem;} |
314 |
+.battery-wrap{height: 10rem;} |
|
315 |
+.battery-img{position: relative; padding: 1.5rem 0 1.5rem 3rem;} |
|
316 |
+.battery-img img{position: absolute; display: none; box-shadow: 1px 1px 14px 1px rgba(0, 0, 0, 0.15); border-radius: 20px;} |
|
317 |
+.battery-img img.show{display: block; } |
|
315 | 318 |
.map svg { |
316 | 319 |
display: block; |
317 | 320 |
} |
... | ... | @@ -329,24 +332,30 @@ |
329 | 332 |
font-weight: 500; |
330 | 333 |
} |
331 | 334 |
.battery p { |
332 |
- font-size: 3rem; |
|
335 |
+ font-size: 2rem; |
|
333 | 336 |
font-weight: bold; |
334 |
- color: rgb(255, 121, 121); |
|
335 | 337 |
text-align: center; |
336 | 338 |
padding-right: 1rem; |
337 | 339 |
} |
338 |
- |
|
339 |
-.battery::after { |
|
340 |
- content: " 남았습니다."; |
|
341 |
- font-size: 1.6rem; |
|
342 |
- font-weight: 500; |
|
343 |
-} |
|
340 |
+.battery p:nth-child(3){font-size: 1.5rem; padding-top: 0.7rem;} |
|
344 | 341 |
|
345 | 342 |
#chartdiv1 { |
346 | 343 |
height: 22vh; |
347 | 344 |
} |
348 | 345 |
|
349 | 346 |
/* ------------------------------------------------보호자 */ |
347 |
+.react-calendar{width: 100%; border: none; height: 54vh;} |
|
348 |
+.react-calendar__month-view__days{padding: 2rem 0;} |
|
349 |
+.react-calendar__month-view__days button{padding: 2.5rem; border: 1px solid #fdede8; border-radius: 0;} |
|
350 |
+.react-calendar__tile--active:enabled:hover, .react-calendar__tile--active:enabled:focus{background: #e26f49;} |
|
351 |
+.react-calendar__tile--active{background: #e26f49;} |
|
352 |
+.weather-info |
|
353 |
+ |
|
354 |
+/* 보호자 복약 */ |
|
355 |
+.guardian-medicine ul li{position: relative;} |
|
356 |
+.guardian-medicine ul li img{position: absolute; display: none;} |
|
357 |
+.guardian-medicine ul li img.show{display: block;} |
|
358 |
+ |
|
350 | 359 |
/* ------------------------------------- main page --------------------------------- */ |
351 | 360 |
/* 사용자 정보*/ |
352 | 361 |
.user-img { |
+++ client/resources/files/images/calendarBig.png
Binary file is not shown |
+++ client/resources/files/images/dinneroff.png
Binary file is not shown |
+++ client/resources/files/images/dinneron.png
Binary file is not shown |
+++ client/resources/files/images/eightypercent.png
Binary file is not shown |
+++ client/resources/files/images/fortypercent.png
Binary file is not shown |
+++ client/resources/files/images/lunchoff.png
Binary file is not shown |
+++ client/resources/files/images/lunchon.png
Binary file is not shown |
+++ client/resources/files/images/mornoff.png
Binary file is not shown |
+++ client/resources/files/images/mornon.png
Binary file is not shown |
+++ client/resources/files/images/pullpercent.png
Binary file is not shown |
+++ client/resources/files/images/senior.png
Binary file is not shown |
+++ client/resources/files/images/sixtypercent.png
Binary file is not shown |
+++ client/resources/files/images/twentypercent.png
Binary file is not shown |
+++ client/resources/files/images/zeropercent.png
Binary file is not shown |
--- client/views/component/Calendar.jsx
+++ client/views/component/Calendar.jsx
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 |
import "react-calendar/dist/Calendar.css"; |
4 | 4 |
import moment from "moment"; |
5 | 5 |
|
6 |
-export default function CalendarComponent(props) { |
|
6 |
+export default function CalendarComponent(props) { |
|
7 | 7 |
const [value, setValue] = useState(new Date()); |
8 | 8 |
const mark = ["12-02-2023", "21-02-2023", "05-02-2023", "02-02-2023"]; |
9 | 9 |
return ( |
+++ client/views/component/DateDay.jsx
... | ... | @@ -0,0 +1,30 @@ |
1 | +import React from "react"; | |
2 | +import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; | |
3 | +import ChevronRightIcon from '@mui/icons-material/ChevronRight'; | |
4 | +import calendar from '../../resources/files/images/calendar.png'; | |
5 | + | |
6 | +export default function DateDay() { | |
7 | + const [date, setDate] = React.useState(); | |
8 | + function clock() { | |
9 | + const date = new Date(); | |
10 | + const year = date.getFullYear(); | |
11 | + const month = date.getMonth() + 1; | |
12 | + const day = date.getDate(); | |
13 | + setDate(`${year}년 ${month}월 ${day}일 `); | |
14 | + } | |
15 | + | |
16 | + | |
17 | + React.useEffect(() => { | |
18 | + clock(); | |
19 | + }, []); | |
20 | + | |
21 | + return ( | |
22 | + <div className="weather-info flex-center"> | |
23 | + <div className="flex-start"> | |
24 | + <ChevronLeftIcon sx={{ width: "33px",height:"33px", marginBottom:"0.8rem", color: "#a5a5a5" }}/> | |
25 | + <div id="fullDate">{date} <img src={calendar} alt="" /></div> | |
26 | + <ChevronRightIcon sx={{ width: "33px",height:"33px", marginBottom:"0.8rem", color: "#a5a5a5" }}/> | |
27 | + </div> | |
28 | + </div> | |
29 | + ); | |
30 | +} |
+++ client/views/component/DateMonth.jsx
... | ... | @@ -0,0 +1,29 @@ |
1 | +import React from "react"; | |
2 | +import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; | |
3 | +import ChevronRightIcon from '@mui/icons-material/ChevronRight'; | |
4 | +import calendar from '../../resources/files/images/calendar.png'; | |
5 | + | |
6 | +export default function DateDay() { | |
7 | + const [date, setDate] = React.useState(); | |
8 | + function clock() { | |
9 | + const date = new Date(); | |
10 | + const year = date.getFullYear(); | |
11 | + const month = date.getMonth() + 1; | |
12 | + setDate(`${year}년 ${month}월`); | |
13 | + } | |
14 | + | |
15 | + | |
16 | + React.useEffect(() => { | |
17 | + clock(); | |
18 | + }, []); | |
19 | + | |
20 | + return ( | |
21 | + <div className="weather-info flex-center"> | |
22 | + <ul className="flex-start"> | |
23 | + <ChevronLeftIcon sx={{ width: "33px",height:"33px", marginBottom:"0.8rem", color: "#a5a5a5" }}/> | |
24 | + <li id="fullDate">{date} <img src={calendar} alt="" /></li> | |
25 | + <ChevronRightIcon sx={{ width: "33px",height:"33px", marginBottom:"0.8rem", color: "#a5a5a5" }}/> | |
26 | + </ul> | |
27 | + </div> | |
28 | + ); | |
29 | +} |
--- client/views/component/Title.jsx
+++ client/views/component/Title.jsx
... | ... | @@ -11,15 +11,12 @@ |
11 | 11 |
} |
12 | 12 |
|
13 | 13 |
const TitleStyle = styled.h4` |
14 |
- font-size: 1.6rem; |
|
14 |
+ font-size: 2.4rem; |
|
15 | 15 |
font-weight: bold; |
16 |
- padding: 0.5rem; |
|
17 | 16 |
margin-right: 1rem; |
18 | 17 |
`; |
19 | 18 |
|
20 | 19 |
const Explanation = styled.p` |
21 | 20 |
font-size: 1.4rem; |
22 |
- padding: 0.5rem; |
|
23 | 21 |
color: #cccccc; |
24 |
- border-left: 2px solid #cccccc; |
|
25 | 22 |
`; |
+++ client/views/component/TitleSmall.jsx
... | ... | @@ -0,0 +1,23 @@ |
1 | +import styled from "styled-components"; | |
2 | +import React from "react"; | |
3 | + | |
4 | +export default function TitleSmall({ title, explanation }) { | |
5 | + return ( | |
6 | + <div className="flex-start"> | |
7 | + <TitleStyle className="title">{title}</TitleStyle> | |
8 | + <Explanation>{explanation}</Explanation> | |
9 | + </div> | |
10 | + ); | |
11 | +} | |
12 | + | |
13 | +const TitleStyle = styled.h4` | |
14 | + font-size: 2rem; | |
15 | + font-weight: bold; | |
16 | + margin-right: 1rem; | |
17 | +`; | |
18 | + | |
19 | +const Explanation = styled.p` | |
20 | + font-size: 1.5rem; | |
21 | + color: rgb(170 170 170); | |
22 | + padding-top: 0.5rem; | |
23 | +`; |
+++ client/views/component/chart/Chart6.jsx
... | ... | @@ -0,0 +1,358 @@ |
1 | +import React, { Component } from "react"; | |
2 | +import * as am5 from "@amcharts/amcharts5"; | |
3 | +import * as am5xy from "@amcharts/amcharts5/xy"; | |
4 | +import am5themes_Animated from "@amcharts/amcharts5/themes/Animated"; | |
5 | + | |
6 | +class Chart6 extends Component { | |
7 | + componentDidMount() { | |
8 | + let root = am5.Root.new("chart6"); | |
9 | + | |
10 | + | |
11 | + root._logo.dispose(); | |
12 | +// Set themes | |
13 | +// https://www.amcharts.com/docs/v5/concepts/themes/ | |
14 | +root.setThemes([ | |
15 | + am5themes_Animated.new(root) | |
16 | +]); | |
17 | + | |
18 | + | |
19 | +root.dateFormatter.setAll({ | |
20 | + dateFormat: "yyyy-MM-dd", | |
21 | + dateFields: ["valueX"] | |
22 | +}); | |
23 | + | |
24 | +let data = [ | |
25 | + { | |
26 | + date: "2021-01-01", | |
27 | + steps: 4561 | |
28 | + }, | |
29 | + { | |
30 | + date: "2021-01-02", | |
31 | + steps: 5687 | |
32 | + }, | |
33 | + { | |
34 | + date: "2021-01-03", | |
35 | + steps: 6348 | |
36 | + }, | |
37 | + { | |
38 | + date: "2021-01-04", | |
39 | + steps: 4878 | |
40 | + }, | |
41 | + { | |
42 | + date: "2021-01-05", | |
43 | + steps: 9867 | |
44 | + }, | |
45 | + { | |
46 | + date: "2021-01-06", | |
47 | + steps: 7561 | |
48 | + }, | |
49 | + { | |
50 | + date: "2021-01-07", | |
51 | + steps: 1287 | |
52 | + }, | |
53 | + { | |
54 | + date: "2021-01-08", | |
55 | + steps: 3298 | |
56 | + }, | |
57 | + { | |
58 | + date: "2021-01-09", | |
59 | + steps: 5697 | |
60 | + }, | |
61 | + { | |
62 | + date: "2021-01-10", | |
63 | + steps: 4878 | |
64 | + }, | |
65 | + { | |
66 | + date: "2021-01-11", | |
67 | + steps: 8788 | |
68 | + }, | |
69 | + { | |
70 | + date: "2021-01-12", | |
71 | + steps: 9560 | |
72 | + }, | |
73 | + { | |
74 | + date: "2021-01-13", | |
75 | + steps: 11687 | |
76 | + }, | |
77 | + { | |
78 | + date: "2021-01-14", | |
79 | + steps: 5878 | |
80 | + }, | |
81 | + { | |
82 | + date: "2021-01-15", | |
83 | + steps: 9789 | |
84 | + }, | |
85 | + { | |
86 | + date: "2021-01-16", | |
87 | + steps: 3987 | |
88 | + }, | |
89 | + { | |
90 | + date: "2021-01-17", | |
91 | + steps: 5898 | |
92 | + }, | |
93 | + { | |
94 | + date: "2021-01-18", | |
95 | + steps: 9878 | |
96 | + }, | |
97 | + { | |
98 | + date: "2021-01-19", | |
99 | + steps: 13687 | |
100 | + }, | |
101 | + { | |
102 | + date: "2021-01-20", | |
103 | + steps: 6789 | |
104 | + }, | |
105 | + { | |
106 | + date: "2021-01-21", | |
107 | + steps: 4531 | |
108 | + }, | |
109 | + { | |
110 | + date: "2021-01-22", | |
111 | + steps: 5856 | |
112 | + }, | |
113 | + { | |
114 | + date: "2021-01-23", | |
115 | + steps: 5737 | |
116 | + }, | |
117 | + { | |
118 | + date: "2021-01-24", | |
119 | + steps: 9987 | |
120 | + }, | |
121 | + { | |
122 | + date: "2021-01-25", | |
123 | + steps: 16457 | |
124 | + }, | |
125 | + { | |
126 | + date: "2021-01-26", | |
127 | + steps: 7878 | |
128 | + }, | |
129 | + { | |
130 | + date: "2021-01-27", | |
131 | + steps: 6845 | |
132 | + }, | |
133 | + { | |
134 | + date: "2021-01-28", | |
135 | + steps: 4659 | |
136 | + }, | |
137 | + { | |
138 | + date: "2021-01-29", | |
139 | + steps: 7892 | |
140 | + }, | |
141 | + { | |
142 | + date: "2021-01-30", | |
143 | + steps: 7362 | |
144 | + }, | |
145 | + { | |
146 | + date: "2021-01-31", | |
147 | + steps: 3268 | |
148 | + } | |
149 | +]; | |
150 | + | |
151 | +// Create chart | |
152 | +// https://www.amcharts.com/docs/v5/charts/xy-chart/ | |
153 | +let chart = root.container.children.push( | |
154 | + am5xy.XYChart.new(root, { | |
155 | + focusable: true, | |
156 | + panX: true, | |
157 | + panY: false, | |
158 | + wheelX: "panX", | |
159 | + wheelY: "none" | |
160 | + }) | |
161 | +); | |
162 | + | |
163 | +let easing = am5.ease.linear; | |
164 | + | |
165 | +// hide zoomout button | |
166 | +chart.zoomOutButton.set("forceHidden", true); | |
167 | + | |
168 | +// add label | |
169 | +chart.plotContainer.children.push( | |
170 | + am5.Label.new(root, { text: "Pan chart to change date", x: 100, y: 50 }) | |
171 | +); | |
172 | + | |
173 | +// Create axes | |
174 | +// https://www.amcharts.com/docs/v5/charts/xy-chart/axes/ | |
175 | +let xRenderer = am5xy.AxisRendererX.new(root, { | |
176 | + minGridDistance: 50, | |
177 | + strokeOpacity: 0.2 | |
178 | +}); | |
179 | +xRenderer.grid.template.set("forceHidden", true); | |
180 | + | |
181 | +let xAxis = chart.xAxes.push( | |
182 | + am5xy.DateAxis.new(root, { | |
183 | + maxDeviation: 0.49, | |
184 | + snapTooltip: false, | |
185 | + baseInterval: { | |
186 | + timeUnit: "day", | |
187 | + count: 1 | |
188 | + }, | |
189 | + renderer: xRenderer, | |
190 | + tooltip: am5.Tooltip.new(root, {}) | |
191 | + }) | |
192 | +); | |
193 | + | |
194 | +let yRenderer = am5xy.AxisRendererY.new(root, { inside: true }); | |
195 | +yRenderer.grid.template.set("forceHidden", true); | |
196 | + | |
197 | +let yAxis = chart.yAxes.push( | |
198 | + am5xy.ValueAxis.new(root, { | |
199 | + maxDeviation: 0, | |
200 | + renderer: yRenderer | |
201 | + }) | |
202 | +); | |
203 | + | |
204 | +// Add series | |
205 | +// https://www.amcharts.com/docs/v5/charts/xy-chart/series/ | |
206 | +let series = chart.series.push( | |
207 | + am5xy.ColumnSeries.new(root, { | |
208 | + xAxis: xAxis, | |
209 | + yAxis: yAxis, | |
210 | + valueYField: "steps", | |
211 | + valueXField: "date", | |
212 | + tooltip: am5.Tooltip.new(root, { | |
213 | + pointerOrientation: "vertical", | |
214 | + labelText: "{valueY}" | |
215 | + }) | |
216 | + }) | |
217 | +); | |
218 | + | |
219 | +series.columns.template.setAll({ | |
220 | + cornerRadiusTL: 15, | |
221 | + cornerRadiusTR: 15, | |
222 | + maxWidth: 30, | |
223 | + strokeOpacity: 0 | |
224 | +}); | |
225 | + | |
226 | +series.columns.template.adapters.add("fill", function (fill, target) { | |
227 | + if (target.dataItem.get("valueY") < 6000) { | |
228 | + return am5.color(0xdadada); | |
229 | + } | |
230 | + return fill; | |
231 | +}); | |
232 | + | |
233 | +// Set up data processor to parse string dates | |
234 | +// https://www.amcharts.com/docs/v5/concepts/data/#Pre_processing_data | |
235 | +series.data.processor = am5.DataProcessor.new(root, { | |
236 | + dateFormat: "yyyy-MM-dd", | |
237 | + dateFields: ["date"] | |
238 | +}); | |
239 | + | |
240 | +series.data.setAll(data); | |
241 | + | |
242 | +// do not allow tooltip to move horizontally | |
243 | +series.get("tooltip").adapters.add("x", function (x) { | |
244 | + return chart.plotContainer.toGlobal({ | |
245 | + x: chart.plotContainer.width() / 2, | |
246 | + y: 0 | |
247 | + }).x; | |
248 | +}); | |
249 | + | |
250 | +// add ranges | |
251 | +let goalRange = yAxis.createAxisRange(yAxis.makeDataItem({ | |
252 | + value: 6000 | |
253 | +})); | |
254 | + | |
255 | +goalRange.get("grid").setAll({ | |
256 | + forceHidden: false, | |
257 | + strokeOpacity: 0.2 | |
258 | +}); | |
259 | + | |
260 | +let goalLabel = goalRange.get("label"); | |
261 | + | |
262 | +goalLabel.setAll({ | |
263 | + centerY: am5.p100, | |
264 | + centerX: am5.p100, | |
265 | + text: "Goal" | |
266 | +}); | |
267 | + | |
268 | +// put to other side | |
269 | +goalLabel.adapters.add("x", function (x) { | |
270 | + return chart.plotContainer.width(); | |
271 | +}); | |
272 | + | |
273 | +let goalRange2 = yAxis.createAxisRange(yAxis.makeDataItem({ | |
274 | + value: 12000 | |
275 | +})); | |
276 | + | |
277 | +goalRange2.get("grid").setAll({ | |
278 | + forceHidden: false, | |
279 | + strokeOpacity: 0.2 | |
280 | +}); | |
281 | + | |
282 | +let goalLabel2 = goalRange2.get("label"); | |
283 | + | |
284 | +goalLabel2.setAll({ | |
285 | + centerY: am5.p100, | |
286 | + centerX: am5.p100, | |
287 | + text: "2 x Goal" | |
288 | +}); | |
289 | + | |
290 | +// put to other side | |
291 | +goalLabel2.adapters.add("x", function (x) { | |
292 | + return chart.plotContainer.width(); | |
293 | +}); | |
294 | + | |
295 | +// reposition when width changes | |
296 | +chart.plotContainer.onPrivate("width", function () { | |
297 | + goalLabel.markDirtyPosition(); | |
298 | + goalLabel2.markDirtyPosition(); | |
299 | +}); | |
300 | + | |
301 | +// Add cursor | |
302 | +// https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/ | |
303 | +let cursor = chart.set("cursor", am5xy.XYCursor.new(root, { | |
304 | + alwaysShow: true, | |
305 | + behavior: "none", | |
306 | + positionX: 0.5 // make it always be at the center | |
307 | +})); | |
308 | +cursor.lineY.set("visible", false); | |
309 | + | |
310 | +// zoom to last 11 days | |
311 | +series.events.on("datavalidated", function () { | |
312 | + let toTime = | |
313 | + series.dataItems[series.dataItems.length - 1].get("valueX") + | |
314 | + am5.time.getDuration("day", 1); | |
315 | + let fromTime = series.dataItems[series.dataItems.length - 11].get("valueX"); | |
316 | + | |
317 | + xAxis.zoomToValues(fromTime, toTime); | |
318 | +}); | |
319 | + | |
320 | +// when plot are is released, round zoom to nearest days | |
321 | +chart.plotContainer.events.on("globalpointerup", function () { | |
322 | + let dayDuration = am5.time.getDuration("day", 1); | |
323 | + | |
324 | + let firstTime = am5.time | |
325 | + .round(new Date(series.dataItems[0].get("valueX")), "day", 1) | |
326 | + .getTime(); | |
327 | + let lastTime = | |
328 | + series.dataItems[series.dataItems.length - 1].get("valueX") + dayDuration; | |
329 | + let totalTime = lastTime - firstTime; | |
330 | + let days = totalTime / dayDuration; | |
331 | + | |
332 | + let roundedStart = | |
333 | + firstTime + Math.round(days * xAxis.get("start")) * dayDuration; | |
334 | + let roundedEnd = | |
335 | + firstTime + Math.round(days * xAxis.get("end")) * dayDuration; | |
336 | + | |
337 | + xAxis.zoomToValues(roundedStart, roundedEnd); | |
338 | +}); | |
339 | + | |
340 | +// Make stuff animate on load | |
341 | +// https://www.amcharts.com/docs/v5/concepts/animations/ | |
342 | +chart.appear(1000, 50); | |
343 | + | |
344 | + | |
345 | + } | |
346 | + | |
347 | + componentWillUnmount() { | |
348 | + if (this.root) { | |
349 | + this.root.dispose(); | |
350 | + } | |
351 | + } | |
352 | + | |
353 | + render() { | |
354 | + return <div id="chart6" style={{ width: "100%", height: "22vh" }}></div>; | |
355 | + } | |
356 | +} | |
357 | + | |
358 | +export default Chart6; |
--- client/views/pages/main/Main_guardian.jsx
+++ client/views/pages/main/Main_guardian.jsx
... | ... | @@ -2,13 +2,31 @@ |
2 | 2 |
import Title from "../../component/Title.jsx"; |
3 | 3 |
import Table from "../../component/Table.jsx"; |
4 | 4 |
import Calendar from "../../component/Calendar.jsx"; |
5 |
+import TitleSmall from "../../component/TitleSmall.jsx"; |
|
6 |
+import DateDay from "../../component/DateDay.jsx"; |
|
7 |
+import DateMonth from "../../component/DateMonth.jsx"; |
|
8 |
+import Chart6 from "../../component/chart/Chart6.jsx"; |
|
5 | 9 |
import ClearIcon from '@mui/icons-material/Clear'; |
6 |
-import BatteryCharging20Icon from '@mui/icons-material/BatteryCharging20'; |
|
7 |
-import DeviceThermostatIcon from '@mui/icons-material/DeviceThermostat'; |
|
8 |
-import MedicationIcon from '@mui/icons-material/Medication'; |
|
9 |
-import AssignmentTurnedInIcon from '@mui/icons-material/AssignmentTurnedIn'; |
|
10 | 10 |
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; |
11 | 11 |
import ErrorIcon from '@mui/icons-material/Error'; |
12 |
+import Senior from '../../../resources/files/images/senior.png'; |
|
13 |
+import battery from '../../../resources/files/images/battery.png'; |
|
14 |
+import zeropercent from '../../../resources/files/images/zeropercent.png'; |
|
15 |
+import pullpercent from '../../../resources/files/images/pullpercent.png'; |
|
16 |
+import twentypercent from '../../../resources/files/images/twentypercent.png'; |
|
17 |
+import fortypercent from '../../../resources/files/images/fortypercent.png'; |
|
18 |
+import eightytypercent from '../../../resources/files/images/eightypercent.png'; |
|
19 |
+import sixtytypercent from '../../../resources/files/images/sixtypercent.png'; |
|
20 |
+import calendar from '../../../resources/files/images/calendar.png'; |
|
21 |
+import temperature from '../../../resources/files/images/temperature.png'; |
|
22 |
+import medicine from '../../../resources/files/images/medicine.png'; |
|
23 |
+import calendarBig from '../../../resources/files/images/calendarBig.png'; |
|
24 |
+import mornon from '../../../resources/files/images/mornon.png'; |
|
25 |
+import mornoff from '../../../resources/files/images/mornoff.png'; |
|
26 |
+import lunchon from '../../../resources/files/images/lunchon.png'; |
|
27 |
+import lunchoff from '../../../resources/files/images/lunchoff.png'; |
|
28 |
+import dinneron from '../../../resources/files/images/dinneron.png'; |
|
29 |
+import dinneroff from '../../../resources/files/images/dinneroff.png'; |
|
12 | 30 |
|
13 | 31 |
export default function Main_guardian() { |
14 | 32 |
const tableHead1 = ["", "", "", "", "", ""]; |
... | ... | @@ -65,77 +83,64 @@ |
65 | 83 |
return ( |
66 | 84 |
<> |
67 | 85 |
<main> |
68 |
- <div><Title title={"김복남 어르신"} explanation={"방문, 복약, 온도, 배터리 현황을 확인하세요."} /></div> |
|
86 |
+ <div className="flex-start main-guardian"><img src={Senior} alt="" /><Title title={"김복남 어르신"} explanation={"방문, 복약, 온도, 배터리 현황을 확인하세요."} /></div> |
|
69 | 87 |
<div className="main-grid-guardian"> |
70 |
- <ul className="content-box statistics-guardian"> |
|
71 |
- <li className="flex-start"> |
|
72 |
- <p><AssignmentTurnedInIcon sx={{ width: "5rem", height: "5rem", color: "#bf0629", borderRadius: "50px" }} /></p> |
|
73 |
- <p>방문 체크</p> |
|
74 |
- <p>이번달 보호사님이 방문한 횟수는 총 4회 입니다.</p> |
|
75 |
- </li> |
|
76 |
- <Calendar /> |
|
77 |
- </ul> |
|
78 |
- <ul className="content-box statistics-guardian"> |
|
79 |
- <li className="flex-start"> |
|
80 |
- <p><MedicationIcon sx={{ width: "5rem", height: "5rem", color: "#0dd390", borderRadius: "50px" }} /></p> |
|
81 |
- <p>복약 체크</p> |
|
82 |
- <p>약을 잘 복용하고 계신지 체크해주세요</p> |
|
83 |
- </li> |
|
84 |
- <li className="flex"> |
|
85 |
- <p className="guardian-table-text">어제</p> |
|
86 |
- <p className="guardian-table-inner"><Table |
|
87 |
- className={"guardian-table"} |
|
88 |
- head={tableHead1} |
|
89 |
- contents={content1} |
|
90 |
- contentKey={Key1} |
|
91 |
- /></p> |
|
92 |
- </li> |
|
93 |
- <li className="flex"> |
|
94 |
- <p className="guardian-table-text">2일 전</p> |
|
95 |
- <p className="guardian-table-inner"><Table |
|
96 |
- className={"guardian-table"} |
|
97 |
- head={tableHead2} |
|
98 |
- contents={content2} |
|
99 |
- contentKey={Key2} |
|
100 |
- /></p> |
|
101 |
- </li> |
|
102 |
- <li className="flex"> |
|
103 |
- <p className="guardian-table-text">3일 전</p> |
|
104 |
- <p className="guardian-table-inner"><Table |
|
105 |
- className={"guardian-table"} |
|
106 |
- head={tableHead1} |
|
107 |
- contents={content1} |
|
108 |
- contentKey={Key1} |
|
109 |
- /></p> |
|
110 |
- </li> |
|
111 |
- </ul> |
|
112 |
- <ul className="content-box statistics-guardian"> |
|
113 |
- <li className="flex-start"> |
|
114 |
- <p><DeviceThermostatIcon sx={{ width: "5rem", height: "5rem", color: "#f1de05", borderRadius: "50px" }} /></p> |
|
115 |
- <p>온도 체크</p> |
|
116 |
- <p>댁내 온도가 적절한지 체크해보세요.</p> |
|
117 |
- </li> |
|
118 |
- <li className="flex"> |
|
119 |
- <p className="guardian-table-inner"><Table |
|
120 |
- className={"guardian-table1"} |
|
121 |
- head={tableHead3} |
|
122 |
- contents={content3} |
|
123 |
- contentKey={Key3} |
|
124 |
- /></p> |
|
88 |
+ <div className=" statistics-guardian combine-left2 combine-middle-government"> |
|
89 |
+ <div className="flex-start margin-bottom2"><img src={calendarBig} alt="" /><TitleSmall title={"방문체크"} /></div> |
|
90 |
+ <ul > |
|
91 |
+ <li> |
|
92 |
+ <Calendar /> |
|
93 |
+ </li> |
|
94 |
+ </ul> |
|
95 |
+ </div> |
|
96 |
+ <div className=" statistics-guardian combine-right3"> |
|
97 |
+ <div className="flex-start margin-bottom2"><img src={temperature} alt="" /><TitleSmall title={"온도체크"} explanation={"댁내 온도가 적절한지 체크해보세요."}/></div> |
|
98 |
+ <ul > |
|
99 |
+ <li> |
|
100 |
+ <DateMonth /> |
|
101 |
+ <Chart6 /> |
|
125 | 102 |
</li> |
126 |
- </ul> |
|
127 |
- <ul className="content-box statistics-guardian"> |
|
128 |
- <li className="flex-start"> |
|
129 |
- <p><BatteryCharging20Icon sx={{ width: "5rem", height: "5rem", color: "#5f9af3", borderRadius: "50px" }} /></p> |
|
130 |
- <p>현재 스마트 약상자의 배터리가 40% 입니다.</p> |
|
131 |
- <p></p> |
|
132 |
- </li> |
|
133 |
- <li> |
|
134 |
- <p className="red"><ErrorIcon sx={{ width: "1rem", height: "1rem", color: "red", borderRadius: "50px" }}/>충전이 필요합니다.</p> |
|
135 |
- </li> |
|
136 |
- </ul> |
|
137 |
- <div className="content-box combine-left combine-all-government"> |
|
138 |
- |
|
103 |
+ </ul> |
|
104 |
+ </div> |
|
105 |
+ |
|
106 |
+ <div className="statistics-guardian combine-right3"> |
|
107 |
+ <div className="flex-start margin-bottom2"><img src={medicine} alt="" /><TitleSmall title={"복약체크"} explanation={"약을 잘 복용하고 계신지 체크해주세요."}/></div> |
|
108 |
+ <ul className=""> |
|
109 |
+ <li className="guardian-medicine"> |
|
110 |
+ <DateDay /> |
|
111 |
+ <ul className="flex"> |
|
112 |
+ <li> |
|
113 |
+ <img src={mornon} alt="" className="show"/> |
|
114 |
+ <img src={mornoff} alt="" /> |
|
115 |
+ </li> |
|
116 |
+ <li> |
|
117 |
+ <img src={lunchon} alt="" /> |
|
118 |
+ <img src={lunchoff} alt="" className="show"/> |
|
119 |
+ </li> |
|
120 |
+ <li> |
|
121 |
+ <img src={dinneron} alt="" /> |
|
122 |
+ <img src={dinneroff} alt="" className="show"/> |
|
123 |
+ </li> |
|
124 |
+ </ul> |
|
125 |
+ </li> |
|
126 |
+ </ul> |
|
127 |
+ </div> |
|
128 |
+ <div className="combine-left combine-all-government battery-wrap "> |
|
129 |
+ <div className="battery flex-start"><img src={battery} alt="" /><p>현재 스마트 약상자의 배터리가 <em className="red">40</em>% 입니다.</p><p className="red">※충전이 필요합니다.</p></div> |
|
130 |
+ <div className="battery-img"> |
|
131 |
+ {/* 0%일때 */} |
|
132 |
+ <img src={zeropercent} alt="" /> |
|
133 |
+ {/* 0~20%일때 */} |
|
134 |
+ <img src={twentypercent} alt="" /> |
|
135 |
+ {/* 20~40%일때 */} |
|
136 |
+ <img src={fortypercent} alt="" className="show"/> |
|
137 |
+ {/* 40~60%일때 */} |
|
138 |
+ <img src={sixtytypercent} alt="" /> |
|
139 |
+ {/* 60~80% 일때 */} |
|
140 |
+ <img src={eightytypercent} alt="" /> |
|
141 |
+ {/* 80~100%일때 */} |
|
142 |
+ <img src={pullpercent} alt="" /> |
|
143 |
+ </div> |
|
139 | 144 |
|
140 | 145 |
</div> |
141 | 146 |
</div> |
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?