--- client/resources/css/reset.css
+++ client/resources/css/reset.css
... | ... | @@ -82,17 +82,15 @@ |
82 | 82 |
border: 1px solid #d8d3c7; |
83 | 83 |
} |
84 | 84 |
|
85 |
-input::-webkit-outer-spin-button, |
|
86 |
-input::-webkit-inner-spin-button { |
|
85 |
+input[type=number]:not(.spin)::-webkit-outer-spin-button, |
|
86 |
+input[type=number]:not(.spin)::-webkit-inner-spin-button { |
|
87 | 87 |
-webkit-appearance: none; |
88 | 88 |
margin: 0; |
89 | 89 |
} |
90 |
- |
|
91 | 90 |
/* Firefox */ |
92 |
-input[type=number] { |
|
91 |
+input[type=number]:not(.spin) { |
|
93 | 92 |
-moz-appearance: textfield; |
94 | 93 |
} |
95 |
- |
|
96 | 94 |
input[type="button"]{ |
97 | 95 |
width: 100%; |
98 | 96 |
background: none; |
--- client/views/component/chart/Chart1.jsx
+++ client/views/component/chart/Chart1.jsx
... | ... | @@ -4,6 +4,17 @@ |
4 | 4 |
import am5themes_Animated from "@amcharts/amcharts5/themes/Animated"; |
5 | 5 |
|
6 | 6 |
class Chart1 extends Component { |
7 |
+ |
|
8 |
+ constructor(props) { |
|
9 |
+ super(props); |
|
10 |
+ |
|
11 |
+ console.log("chart data11 : ", this.props.data); |
|
12 |
+ } |
|
13 |
+ |
|
14 |
+ componentWillReceiveProps(nextProps) { |
|
15 |
+ console.log("chart data22 : ", nextProps.data); |
|
16 |
+ } |
|
17 |
+ |
|
7 | 18 |
componentDidMount() { |
8 | 19 |
let root1 = am5.Root.new("chartdiv1"); |
9 | 20 |
|
--- client/views/layout/Menu.jsx
+++ client/views/layout/Menu.jsx
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 |
}).then((response) => response.json()).then((data) => { |
29 | 29 |
console.log("로그아웃 결과 : ", data); |
30 | 30 |
if (data == true) { |
31 |
- navigate('/Main'); |
|
31 |
+ navigate('/'); |
|
32 | 32 |
} else { |
33 | 33 |
alert('로그아웃 실패, 관리자에게 문의바랍니다.'); |
34 | 34 |
} |
--- client/views/pages/AppRoute.jsx
+++ client/views/pages/AppRoute.jsx
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 |
|
10 | 10 |
import HouseIcon from "@mui/icons-material/House"; |
11 | 11 |
import PersonIcon from "@mui/icons-material/Person"; |
12 |
+import CorporateFareIcon from '@mui/icons-material/CorporateFare'; |
|
12 | 13 |
import Diversity1Icon from "@mui/icons-material/Diversity1"; |
13 | 14 |
import SpeakerPhoneIcon from "@mui/icons-material/SpeakerPhone"; |
14 | 15 |
import SettingsIcon from "@mui/icons-material/Settings"; |
... | ... | @@ -67,26 +68,26 @@ |
67 | 68 |
const AdminAppMenuItems = [ |
68 | 69 |
{ |
69 | 70 |
title: "Home", |
70 |
- path: "/Main", |
|
71 |
+ path: "/", |
|
71 | 72 |
icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />, |
72 | 73 |
}, |
73 | 74 |
{ |
74 | 75 |
title: "기관 관리", |
76 |
+ path: "/OrgSelect", |
|
77 |
+ icon: ( |
|
78 |
+ <CorporateFareIcon |
|
79 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
80 |
+ /> |
|
81 |
+ ), |
|
82 |
+ }, |
|
83 |
+ { |
|
84 |
+ title: "사용자 관리", |
|
85 |
+ path: "/UserSelect", |
|
75 | 86 |
icon: ( |
76 | 87 |
<PersonIcon |
77 | 88 |
sx={{ fontSize: 20, marginRight: 1 }} |
78 | 89 |
/> |
79 | 90 |
), |
80 |
- childrens: [ |
|
81 |
- { |
|
82 |
- title: "기관 관리", |
|
83 |
- path: "/OrgSelect", |
|
84 |
- }, |
|
85 |
- { |
|
86 |
- title: "사용자 관리", |
|
87 |
- path: "/UserSelect", |
|
88 |
- }, |
|
89 |
- ], |
|
90 | 91 |
}, |
91 | 92 |
{ |
92 | 93 |
title: "장비 관리", |
... | ... | @@ -133,7 +134,7 @@ |
133 | 134 |
|
134 | 135 |
<Route path="/Medicalcare" element={<Medicalcare />}></Route> |
135 | 136 |
<Route path="/Healthcare" element={<Healthcare />}></Route> |
136 |
- <Route path="/Main" element={<Main />}></Route> |
|
137 |
+ <Route path="/" element={<Main />}></Route> |
|
137 | 138 |
<Route path="/EquipmentRentalInsert" element={<EquipmentRentalInsert />}></Route> |
138 | 139 |
<Route path="/EquipmentManagementInsert" element={<EquipmentManagementInsert />}></Route> |
139 | 140 |
<Route path="/EquipmentSelect" element={<EquipmentSelect />}></Route> |
... | ... | @@ -163,26 +164,26 @@ |
163 | 164 |
const GovernmentAppMenuItems = [ |
164 | 165 |
{ |
165 | 166 |
title: "Home", |
166 |
- path: "/Main", |
|
167 |
+ path: "/", |
|
167 | 168 |
icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />, |
168 | 169 |
}, |
169 | 170 |
{ |
170 | 171 |
title: "기관 관리", |
172 |
+ path: "/OrgSelect", |
|
173 |
+ icon: ( |
|
174 |
+ <CorporateFareIcon |
|
175 |
+ sx={{ fontSize: 20, marginRight: 1 }} |
|
176 |
+ /> |
|
177 |
+ ), |
|
178 |
+ }, |
|
179 |
+ { |
|
180 |
+ title: "사용자 관리", |
|
181 |
+ path: "/UserSelect", |
|
171 | 182 |
icon: ( |
172 | 183 |
<PersonIcon |
173 | 184 |
sx={{ fontSize: 20, marginRight: 1 }} |
174 | 185 |
/> |
175 | 186 |
), |
176 |
- childrens: [ |
|
177 |
- { |
|
178 |
- title: "기관 관리", |
|
179 |
- path: "/OrgSelect", |
|
180 |
- }, |
|
181 |
- { |
|
182 |
- title: "사용자 관리", |
|
183 |
- path: "/UserSelect", |
|
184 |
- }, |
|
185 |
- ], |
|
186 | 187 |
}, |
187 | 188 |
{ |
188 | 189 |
title: "장비 관리", |
... | ... | @@ -250,7 +251,7 @@ |
250 | 251 |
|
251 | 252 |
<Route path="/Medicalcare" element={<Medicalcare />}></Route> |
252 | 253 |
<Route path="/Healthcare" element={<Healthcare />}></Route> |
253 |
- <Route path="/Main" element={<Main_government />}></Route> |
|
254 |
+ <Route path="/" element={<Main_government />}></Route> |
|
254 | 255 |
<Route path="/AgencySelect" element={<AgencySelect />}></Route> |
255 | 256 |
<Route path="/UserSelectOk" element={<UserSelectOk />}></Route> |
256 | 257 |
<Route path="/MedicineCareSelectOne" element={<MedicineCareSelectOne />}></Route> |
... | ... | @@ -280,7 +281,7 @@ |
280 | 281 |
const AgencyAppMenuItems = [ |
281 | 282 |
{ |
282 | 283 |
title: "Home", |
283 |
- path: "/Main", |
|
284 |
+ path: "/", |
|
284 | 285 |
icon: <HouseIcon sx={{ fontSize: 20, color: "#333333", marginRight: 1 }} />, |
285 | 286 |
}, |
286 | 287 |
{ |
... | ... | @@ -330,7 +331,7 @@ |
330 | 331 |
<Route path="/Join" element={<Join />}></Route> |
331 | 332 |
<Route path="/QuestionSelect" element={<QuestionSelect />}></Route> |
332 | 333 |
|
333 |
- <Route path="/Main" element={<Main_agency />}></Route> |
|
334 |
+ <Route path="/" element={<Main_agency />}></Route> |
|
334 | 335 |
<Route path="/AgencySeniorSelect" element={<AgencySeniorSelect />}></Route> |
335 | 336 |
<Route path="/SeniorEdit" element={<SeniorEdit />}></Route> |
336 | 337 |
<Route path="/SeniorSelectOne" element={<SeniorSelectOne />}></Route> |
... | ... | @@ -367,7 +368,7 @@ |
367 | 368 |
const GuardianAppMenuItems = [ |
368 | 369 |
{ |
369 | 370 |
title: "Home", |
370 |
- path: "/Main", |
|
371 |
+ path: "/", |
|
371 | 372 |
icon: <HouseIcon sx={{ fontSize: 20, marginRight: 1 }} />, |
372 | 373 |
}, |
373 | 374 |
{ |
... | ... | @@ -389,7 +390,7 @@ |
389 | 390 |
return ( |
390 | 391 |
<Routes> |
391 | 392 |
<Route path="/GuardianStatistics" element={<GuardianStatistics />}></Route> |
392 |
- <Route path="/Main" element={<Main_guardian />}></Route> |
|
393 |
+ <Route path="/" element={<Main_guardian />}></Route> |
|
393 | 394 |
<Route path="/QandAInsert" element={<QandAInsert />}></Route> |
394 | 395 |
<Route path="/QandASelect" element={<QandASelect />}></Route> |
395 | 396 |
<Route path="/QandASelectOne" element={<QandASelectOne />}></Route> |
--- client/views/pages/equipment/EquipmentSelect.jsx
+++ client/views/pages/equipment/EquipmentSelect.jsx
... | ... | @@ -540,11 +540,11 @@ |
540 | 540 |
const [tabIndex, setTabIndex] = React.useState(defaultTabIndex); |
541 | 541 |
//탭 초기화 |
542 | 542 |
const tab = [{ |
543 |
- title: `신규 장비 (${newEquipment.equipmentListCount})`, |
|
543 |
+ title: `미등록 장비 (${newEquipment.equipmentListCount})`, |
|
544 | 544 |
content: ( |
545 | 545 |
<div> |
546 | 546 |
<div className="flex equip-tab"> |
547 |
- <SubTitle explanation={"데이터 수집 정보로부터 신규 등록된 장비 목록입니다. ★장비 정보를 업데이트해주세요.★"} /> |
|
547 |
+ <SubTitle explanation={"데이터 통신을 통해 확인된 장비 목록입니다. ★장비 정보를 업데이트해주세요.★"} /> |
|
548 | 548 |
{/* <div className="btn-wrap flex-end margin-bottom "> |
549 | 549 |
{isEquipmentDelivery |
550 | 550 |
? <> |
--- client/views/pages/healthcare/Healthcare.jsx
+++ client/views/pages/healthcare/Healthcare.jsx
... | ... | @@ -101,8 +101,13 @@ |
101 | 101 |
<tbody> |
102 | 102 |
{senior.seniorList.map((item, idx) => { return ( |
103 | 103 |
<tr key={idx} onClick={() => { |
104 |
- navigate("/MedicineCareSelectOne"); |
|
105 |
- }}> |
|
104 |
+ navigate("/MedicineCareSelectOne", { |
|
105 |
+ state: { |
|
106 |
+ 'senior_id': item['user_id'], |
|
107 |
+ 'agency_id': item['agency_id'], |
|
108 |
+ 'government_id': item['government_id'] |
|
109 |
+ } |
|
110 |
+ })}}> |
|
106 | 111 |
<td data-label="No">{senior.seniorListCount - idx - (senior.search.currentPage - 1) * senior.search.perPage}</td> |
107 | 112 |
<td data-label="소속기관명">{item['agency_name']}</td> |
108 | 113 |
<td data-label="이름">{item['user_name']}</td> |
--- client/views/pages/healthcare/medicinecare/MedicineCareSelectOne.jsx
+++ client/views/pages/healthcare/medicinecare/MedicineCareSelectOne.jsx
... | ... | @@ -1,7 +1,9 @@ |
1 | 1 |
import React from "react"; |
2 |
+import { useNavigate, useLocation } from "react-router"; |
|
3 |
+ |
|
2 | 4 |
import Button from "../../../component/Button.jsx"; |
3 | 5 |
import Modal from "../../../component/Modal.jsx"; |
4 |
-import { useNavigate } from "react-router"; |
|
6 |
+ |
|
5 | 7 |
import Chart1 from "../../../component/chart/Chart1.jsx"; |
6 | 8 |
import Chart3 from "../../../component/chart/Chart3.jsx"; |
7 | 9 |
import Chart from "../../../component/chart/Chart.jsx"; |
... | ... | @@ -12,8 +14,117 @@ |
12 | 14 |
import LineColor_medicine from "../../../component/chart/LineColor_medicine.jsx"; |
13 | 15 |
import MedicationIcon from '@mui/icons-material/Medication'; |
14 | 16 |
|
17 |
+import CommonUtil from "../../../../resources/js/CommonUtil.js"; |
|
18 |
+ |
|
15 | 19 |
export default function MedicineCareSelectOne() { |
16 | 20 |
const navigate = useNavigate(); |
21 |
+ const location = useLocation(); |
|
22 |
+ |
|
23 |
+ //시니어 정보 |
|
24 |
+ const [senior, setSenior] = React.useState({ |
|
25 |
+ 'user_id': location.state['senior_id'], |
|
26 |
+ 'user_name': null, |
|
27 |
+ 'user_password': null, |
|
28 |
+ 'user_phonenumber': null, |
|
29 |
+ 'user_birth': null, |
|
30 |
+ 'user_gender': null, |
|
31 |
+ 'user_address': null, |
|
32 |
+ 'user_email': null, |
|
33 |
+ 'authority': 'ROLE_SENIOR', |
|
34 |
+ 'agency_id': location.state['agency_id'], |
|
35 |
+ 'government_id': location.state['government_id'], |
|
36 |
+ |
|
37 |
+ 'senior_id': location.state['senior_id'], |
|
38 |
+ 'care_grade': null, |
|
39 |
+ 'medication_pill': null, |
|
40 |
+ 'underlie_disease': null, |
|
41 |
+ 'senior_note': null, |
|
42 |
+ |
|
43 |
+ 'seniorMedicationList': [] |
|
44 |
+ }); |
|
45 |
+ //시니어 상세 조회 |
|
46 |
+ const seniorSelectOne = () => { |
|
47 |
+ fetch("/user/seniorSelectOne.json", { |
|
48 |
+ method: "POST", |
|
49 |
+ headers: { |
|
50 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
51 |
+ }, |
|
52 |
+ body: JSON.stringify(senior), |
|
53 |
+ }).then((response) => response.json()).then((data) => { |
|
54 |
+ console.log("seniorSelectOne data : ", data); |
|
55 |
+ setSenior(data); |
|
56 |
+ }).catch((error) => { |
|
57 |
+ console.log('seniorSelectOne() /user/seniorSelectOne.json error : ', error); |
|
58 |
+ }); |
|
59 |
+ }; |
|
60 |
+ |
|
61 |
+ //특정 대상자의 실제 복약 정보 |
|
62 |
+ const [seniorMedicationListAndCount, setSeniorMedicationListAndCount] = React.useState([]); |
|
63 |
+ //특정 대상자의 실제 복약 정보 목록 조회 |
|
64 |
+ const seniorMedicationSelectListAndCount = () => { |
|
65 |
+ fetch("/user/seniorMedicationSelectListAndCount.json", { |
|
66 |
+ method: "POST", |
|
67 |
+ headers: { |
|
68 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
69 |
+ }, |
|
70 |
+ body: JSON.stringify(senior), |
|
71 |
+ }).then((response) => response.json()).then((data) => { |
|
72 |
+ console.log("seniorMedicationSelectListAndCount data : ", data); |
|
73 |
+ setSeniorMedicationListAndCount(data); |
|
74 |
+ seniorMedicationSelectListByDay(); |
|
75 |
+ }).catch((error) => { |
|
76 |
+ console.log('seniorMedicationSelectListAndCount() /user/seniorMedicationSelectListAndCount.json error : ', error); |
|
77 |
+ }); |
|
78 |
+ }; |
|
79 |
+ |
|
80 |
+ //특정 대상자의 일별, 복약시간별 복약 목록 |
|
81 |
+ const [seniorMedicationListByDay, setSeniorMedicationListByDay] = React.useState([]); |
|
82 |
+ const [stackChartData, setStackChartData] = React.useState([]); |
|
83 |
+ //특정 대상자의 일별, 복약시간별 복약 목록 조회 |
|
84 |
+ const seniorMedicationSelectListByDay = () => { |
|
85 |
+ fetch("/user/seniorMedicationSelectListByDay.json", { |
|
86 |
+ method: "POST", |
|
87 |
+ headers: { |
|
88 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
89 |
+ }, |
|
90 |
+ body: JSON.stringify(senior), |
|
91 |
+ }).then((response) => response.json()).then((data) => { |
|
92 |
+ console.log("seniorMedicationListByDay data : ", data); |
|
93 |
+ setSeniorMedicationListByDay(data); |
|
94 |
+ |
|
95 |
+ let showMedicationTimeCode = {}; |
|
96 |
+ for (let i = 0; i < seniorMedicationListAndCount.length; i++) { |
|
97 |
+ if (seniorMedicationListAndCount[i]['medication_time_code_count'] > 0) { |
|
98 |
+ showMedicationTimeCode[seniorMedicationListAndCount[i]['medication_time_code']] = true; |
|
99 |
+ } else { |
|
100 |
+ showMedicationTimeCode[seniorMedicationListAndCount[i]['medication_time_code']] = false; |
|
101 |
+ } |
|
102 |
+ } |
|
103 |
+ |
|
104 |
+ if (CommonUtil.isEmpty(data) == false) { |
|
105 |
+ let _stackChartData = []; |
|
106 |
+ for (let i = 0; i < data.length; i++) { |
|
107 |
+ let chartData = { |
|
108 |
+ xName: data[i]['medication_default_date'] |
|
109 |
+ }; |
|
110 |
+ for (let j = 0; j < data[i]['medication_time_code_list'].length; j++) { |
|
111 |
+ if (showMedicationTimeCode[data[i]['medication_time_code_list'][j]] == true) { |
|
112 |
+ chartData[data[i]['medication_time_code_list'][j]] = chartData[data[i]['medication_time_code_count_list'][j]]; |
|
113 |
+ } else { |
|
114 |
+ continue; |
|
115 |
+ } |
|
116 |
+ } |
|
117 |
+ _stackChartData.push(chartData); |
|
118 |
+ } |
|
119 |
+ setStackChartData(_stackChartData); |
|
120 |
+ } |
|
121 |
+ |
|
122 |
+ }).catch((error) => { |
|
123 |
+ console.log('seniorMedicationSelectListByDay() /user/seniorMedicationSelectListByDay.json error : ', error); |
|
124 |
+ }); |
|
125 |
+ }; |
|
126 |
+ |
|
127 |
+ |
|
17 | 128 |
const [modalOpen, setModalOpen] = React.useState(false); |
18 | 129 |
const openModal = () => { |
19 | 130 |
setModalOpen(true); |
... | ... | @@ -21,6 +132,13 @@ |
21 | 132 |
const closeModal = () => { |
22 | 133 |
setModalOpen(false); |
23 | 134 |
}; |
135 |
+ |
|
136 |
+ |
|
137 |
+ React.useEffect(() => { |
|
138 |
+ seniorSelectOne(); |
|
139 |
+ seniorMedicationSelectListAndCount(); |
|
140 |
+ }, []) |
|
141 |
+ |
|
24 | 142 |
return ( |
25 | 143 |
<main> |
26 | 144 |
<Modal open={modalOpen} close={closeModal} header="복약 내역 수정"> |
... | ... | @@ -108,8 +226,8 @@ |
108 | 226 |
<div className="content-wrap"> |
109 | 227 |
<ContentTitle contentTitle={"복약 상세 페이지"} /> |
110 | 228 |
<div className="detail-graph"> |
111 |
- <TableTitle tableTitle={"복약 내역"} />{/* 님의 복약 내역 */} |
|
112 |
- <Chart1 /> |
|
229 |
+ <TableTitle tableTitle={`${senior['user_name']}님의 복약 내역`} />{/* 님의 복약 내역 */} |
|
230 |
+ <Chart1 data={seniorMedicationListByDay}/> |
|
113 | 231 |
</div> |
114 | 232 |
<div className="medicine-grid margin-bottom"> |
115 | 233 |
<div><SubTitle |
--- client/views/pages/login/Login.jsx
+++ client/views/pages/login/Login.jsx
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 |
}).then((response) => response.json()).then((data) => { |
40 | 40 |
console.log("로그인 결과 : ", data); |
41 | 41 |
if (data.isSuccess == true) { |
42 |
- navigate('/Main'); |
|
42 |
+ navigate('/'); |
|
43 | 43 |
} else { |
44 | 44 |
alert(data.message); |
45 | 45 |
} |
--- client/views/pages/setting/RiskSet.jsx
+++ client/views/pages/setting/RiskSet.jsx
... | ... | @@ -27,19 +27,6 @@ |
27 | 27 |
const riskStandardRef = React.useRef({...riskStandard}); |
28 | 28 |
|
29 | 29 |
|
30 |
- |
|
31 |
- //위험 기준 정보 |
|
32 |
- const [sipal, setSipal] = React.useState({ |
|
33 |
- 'government_id': defaultGovernmentId, |
|
34 |
- 'risk_standard_type': null, |
|
35 |
- 'risk_standard_cycle': null, |
|
36 |
- 'risk_standard_start_value': null, |
|
37 |
- 'risk_standard_end_value': null |
|
38 |
- }); |
|
39 |
- |
|
40 |
- |
|
41 |
- |
|
42 |
- |
|
43 | 30 |
//위험 기준 유효성 검사 |
44 | 31 |
const riskStandardValidation = () => { |
45 | 32 |
const target = riskStandard; |
... | ... | @@ -95,7 +82,7 @@ |
95 | 82 |
}).then((response) => response.json()).then((data) => { |
96 | 83 |
console.log("위험 기준 수정 결과(건수) : ", data); |
97 | 84 |
if (data > 0) { |
98 |
- //riskStandardSelectList(); |
|
85 |
+ riskStandardSelectList(); |
|
99 | 86 |
alert("수정완료"); |
100 | 87 |
} else { |
101 | 88 |
alert("수정에 실패하였습니다. 관리자에게 문의바랍니다."); |
... | ... | @@ -124,13 +111,20 @@ |
124 | 111 |
}); |
125 | 112 |
} |
126 | 113 |
|
114 |
+ //현재 탭 Index |
|
115 |
+ const [tabIndex, setTabIndex] = React.useState(0); |
|
116 |
+ |
|
127 | 117 |
React.useEffect(() => { |
128 | 118 |
riskStandardSelectList(); |
129 | 119 |
console.log('riskStandard : ', riskStandard); |
130 | 120 |
}, []); |
131 |
- |
|
132 |
- //현재 탭 Index |
|
133 |
- const [tabIndex, setTabIndex] = React.useState(0); |
|
121 |
+ |
|
122 |
+ React.useEffect(() => { |
|
123 |
+ console.log('riskStandardList['+tabIndex+'] : ', riskStandardList[tabIndex]); |
|
124 |
+ if (riskStandardList[tabIndex]) { |
|
125 |
+ setRiskStandard(riskStandardList[tabIndex]); |
|
126 |
+ } |
|
127 |
+ }, tabIndex); |
|
134 | 128 |
|
135 | 129 |
//탭 초기화 |
136 | 130 |
const tab = [{ |
... | ... | @@ -142,15 +136,47 @@ |
142 | 136 |
<tr> |
143 | 137 |
<td style={{textAlign: 'right'}}>최근 온도가</td> |
144 | 138 |
<td> |
145 |
- <input type="number" value={riskStandard['risk_standard_start_value']} |
|
139 |
+ <input type="number" className="spin" |
|
140 |
+ value={riskStandard['risk_standard_start_value']} |
|
146 | 141 |
onChange={(e) => { |
147 |
- riskStandard['risk_standard_start_value'] = e.target.value; |
|
142 |
+ let value = e.target.value |
|
143 |
+ if (value < -273) { |
|
144 |
+ alert('절대0도(-273℃) 보다 높아야합니다.'); |
|
145 |
+ value = 0; |
|
146 |
+ } |
|
147 |
+ if (value >= Number(riskStandard['risk_standard_end_value'])) { |
|
148 |
+ alert('최대값 보다는 작아야합니다.'); |
|
149 |
+ value = Number(riskStandard['risk_standard_end_value']) - 1; |
|
150 |
+ } |
|
151 |
+ riskStandard['risk_standard_start_value'] = value; |
|
148 | 152 |
setRiskStandard({...riskStandard}); |
149 | 153 |
}} |
154 |
+ onKeyUp={(e) => {e.key == 'Enter' ? riskStandardUpdate() : null}} |
|
150 | 155 |
ref={el => riskStandardRef.current['risk_standard_start_value'] = el} |
151 | 156 |
/> |
152 | 157 |
</td> |
153 |
- <td style={{textAlign: 'left'}}>이하 일 경우 위험알림으로 지정합니다.</td> |
|
158 |
+ <td style={{textAlign: 'left'}}>이하</td> |
|
159 |
+ <td> |
|
160 |
+ <input type="number" className="spin" |
|
161 |
+ value={riskStandard['risk_standard_end_value']} |
|
162 |
+ onChange={(e) => { |
|
163 |
+ let value = e.target.value |
|
164 |
+ if (value < -273) { |
|
165 |
+ alert('절대0도(-273℃) 보다 높아야합니다.'); |
|
166 |
+ value = 0; |
|
167 |
+ } |
|
168 |
+ if (value <= Number(riskStandard['risk_standard_start_value'])) { |
|
169 |
+ alert('최소값 보다는 커야합니다.'); |
|
170 |
+ value = Number(riskStandard['risk_standard_start_value']) + 1; |
|
171 |
+ } |
|
172 |
+ riskStandard['risk_standard_end_value'] = value; |
|
173 |
+ setRiskStandard({...riskStandard}); |
|
174 |
+ }} |
|
175 |
+ onKeyUp={(e) => {e.key == 'Enter' ? riskStandardUpdate() : null}} |
|
176 |
+ ref={el => riskStandardRef.current['risk_standard_end_value'] = el} |
|
177 |
+ /> |
|
178 |
+ </td> |
|
179 |
+ <td style={{textAlign: 'left'}}>이상 일 경우 위험알림으로 지정합니다.</td> |
|
154 | 180 |
<td style={{textAlign: 'left'}}> |
155 | 181 |
<button className="btn-small gray-btn" onClick={() => {riskStandardUpdate()}}>저장</button> |
156 | 182 |
</td> |
... | ... | @@ -168,12 +194,20 @@ |
168 | 194 |
<tr> |
169 | 195 |
<td style={{textAlign: 'right'}}>최근 미복약 횟수가</td> |
170 | 196 |
<td> |
171 |
- <input type="number" value={riskStandard['risk_standard_start_value']} |
|
197 |
+ <input type="number" className="spin" |
|
198 |
+ value={riskStandard['risk_standard_start_value']} |
|
172 | 199 |
onChange={(e) => { |
173 |
- riskStandard['risk_standard_start_value'] = e.target.value; |
|
200 |
+ let value = e.target.value |
|
201 |
+ if (value < 0) { |
|
202 |
+ alert('0회 이상 이어야합니다.'); |
|
203 |
+ value = 0; |
|
204 |
+ } |
|
205 |
+ riskStandard['risk_standard_start_value'] = value; |
|
174 | 206 |
setRiskStandard({...riskStandard}); |
175 | 207 |
}} |
208 |
+ onKeyUp={(e) => {e.key == 'Enter' ? riskStandardUpdate() : null}} |
|
176 | 209 |
ref={el => riskStandardRef.current['risk_standard_start_value'] = el} |
210 |
+ |
|
177 | 211 |
/> |
178 | 212 |
</td> |
179 | 213 |
<td style={{textAlign: 'left'}}>회 이상일 경우 위험알림으로 지정합니다.</td> |
... | ... | @@ -194,11 +228,21 @@ |
194 | 228 |
<tr> |
195 | 229 |
<td style={{textAlign: 'right'}}>배터리 잔량이 최근</td> |
196 | 230 |
<td> |
197 |
- <input type="number" value={riskStandard['risk_standard_start_value']} |
|
231 |
+ <input type="number" className="spin" |
|
232 |
+ value={riskStandard['risk_standard_start_value']} |
|
198 | 233 |
onChange={(e) => { |
199 |
- riskStandard['risk_standard_start_value'] = e.target.value; |
|
234 |
+ let value = e.target.value |
|
235 |
+ if (value < 0) { |
|
236 |
+ alert('0% 이상 이여야합니다.'); |
|
237 |
+ value = 0; |
|
238 |
+ } else if (value > 99) { |
|
239 |
+ alert('99% 이하 이어야합니다.'); |
|
240 |
+ value = 99; |
|
241 |
+ } |
|
242 |
+ riskStandard['risk_standard_start_value'] = value; |
|
200 | 243 |
setRiskStandard({...riskStandard}); |
201 | 244 |
}} |
245 |
+ onKeyUp={(e) => {e.key == 'Enter' ? riskStandardUpdate() : null}} |
|
202 | 246 |
ref={el => riskStandardRef.current['risk_standard_start_value'] = el} |
203 | 247 |
/> |
204 | 248 |
</td> |
--- firebase-messaging-sw.js
+++ firebase-messaging-sw.js
... | ... | @@ -28,21 +28,21 @@ |
28 | 28 |
console.log("push: ", e.data.json()); |
29 | 29 |
if (!e.data.json()) return; |
30 | 30 |
|
31 |
- const resultData = e.data.json().notification; |
|
32 |
- console.log("push resultData : ", resultData); |
|
33 |
- console.log("push resultData.image : ", resultData.image); |
|
34 |
- const notificationTitle = resultData.title; |
|
31 |
+ const resultData = e.data.json(); |
|
32 |
+ //console.log("push resultData : ", resultData); |
|
33 |
+ const notificationTitle = resultData.notification.title; |
|
35 | 34 |
const notificationOptions = { |
36 |
- body: resultData.body, |
|
37 |
- //icon: resultData.image, // 웹 푸시 이미지는 icon |
|
38 |
- tag: resultData.tag, |
|
35 |
+ body: resultData.notification.body, |
|
36 |
+ icon: resultData.notification.image, // 웹 푸시 이미지는 icon |
|
37 |
+ tag: resultData.notification.tag, |
|
38 |
+ data: resultData.data |
|
39 | 39 |
}; |
40 | 40 |
|
41 | 41 |
self.registration.showNotification(notificationTitle, notificationOptions); |
42 | 42 |
}); |
43 | 43 |
|
44 | 44 |
self.addEventListener("notificationclick", function (event) { |
45 |
- console.log("notification click"); |
|
45 |
+ console.log("notification click event.notification : ", event.notification); |
|
46 | 46 |
const url = "/"; |
47 | 47 |
event.notification.close(); |
48 | 48 |
event.waitUntil(clients.openWindow(url)); |
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?