박정하 박정하 2023-06-16
230616 박정하 기본 비밀번호 사용 여부 확인
@54ff27b0e9a122e093d2149bc802c035de3f18b1
client/resources/css/main.css
--- client/resources/css/main.css
+++ client/resources/css/main.css
@@ -650,7 +650,7 @@
   margin-bottom: .5rem;
 }
 
-@media all and (min-width: 479px) {
+@media all and (min-width: 767px) {
   .calendar-data {
     display: flex;
     justify-content: space-between;
client/views/component/Calendar.jsx
--- client/views/component/Calendar.jsx
+++ client/views/component/Calendar.jsx
@@ -49,12 +49,15 @@
           }
         }}
         onClickDay={(date, event) => {
+          let sendData = { date: moment(date).format("YYYY-MM-DD") };
           data.visitRecordList.map((item, idx) => {
             if (item['visit_date'] === moment(date).format("YYYY-MM-DD")) {
-              data.onClick(moment(date).format("YYYY-MM-DD"), item);
-            } else {
-              data.onClick(moment(date).format("YYYY-MM-DD"));
+              sendData = {
+                date: moment(date).format("YYYY-MM-DD"),
+                visitData: item
+              }
             }
+            data.onClick(sendData);
           })
         }}
         tileContent={({ date, view }) => {
client/views/component/chart/Chart5_agencyadmin.jsx
--- client/views/component/chart/Chart5_agencyadmin.jsx
+++ client/views/component/chart/Chart5_agencyadmin.jsx
@@ -5,10 +5,14 @@
 import CommonUtil from "../../../resources/js/CommonUtil";
 
 
-export default function Chart5({ data }) {
+export default function Chart5() {
   const createChart = () => {
-    console.log('createChart data : ', data);
+
+    /* Chart code */
+    // Create root element
+    // https://www.amcharts.com/docs/v5/getting-started/#Root_element
     let root = am5.Root.new("Chart5");
+
 
     // Set themes
     // https://www.amcharts.com/docs/v5/concepts/themes/
@@ -29,8 +33,8 @@
     let series = chart.series.push(am5percent.PictorialStackedSeries.new(root, {
       alignLabels: true,
       orientation: "vertical",
-      valueField: "count",
-      categoryField: "agency_name",
+      valueField: "value",
+      categoryField: "category",
       svgPath: "M53.5,476c0,14,6.833,21,20.5,21s20.5-7,20.5-21V287h21v189c0,14,6.834,21,20.5,21 c13.667,0,20.5-7,20.5-21V154h10v116c0,7.334,2.5,12.667,7.5,16s10.167,3.333,15.5,0s8-8.667,8-16V145c0-13.334-4.5-23.667-13.5-31 s-21.5-11-37.5-11h-82c-15.333,0-27.833,3.333-37.5,10s-14.5,17-14.5,31v133c0,6,2.667,10.333,8,13s10.5,2.667,15.5,0s7.5-7,7.5-13 V154h10V476 M61.5,42.5c0,11.667,4.167,21.667,12.5,30S92.333,85,104,85s21.667-4.167,30-12.5S146.5,54,146.5,42 c0-11.335-4.167-21.168-12.5-29.5C125.667,4.167,115.667,0,104,0S82.333,4.167,74,12.5S61.5,30.833,61.5,42.5z"
     }));
 
@@ -40,28 +44,25 @@
 
     // Set data
     // https://www.amcharts.com/docs/v5/charts/percent-charts/sliced-chart/#Setting_data
-    /*series.data.setAll([
-      { value: 10, category: "A복지관" },
-      { value: 9, category: "B복지관" },
-      { value: 6, category: "C복지관" },
-      { value: 5, category: "D복지관" },
-      { value: 4, category: "E복지관" },
-    ]);*/
-    series.data.setAll(data);
+    series.data.setAll([
+      { value: 10, category: "One" },
+      { value: 9, category: "Two" },
+      { value: 6, category: "Three" },
+      { value: 5, category: "Four" },
+      { value: 4, category: "Five" },
+      { value: 3, category: "Six" },
+      { value: 1, category: "Seven" }
+    ]);
 
 
     // Play initial series animation
     // https://www.amcharts.com/docs/v5/concepts/animations/#Animation_of_series
     chart.appear(1000, 100);
-    // end am5.ready()
   }
 
   React.useEffect(() => {
-    console.log('React.useEffect data : ', data);
-    if (CommonUtil.isEmpty(data) == false) {
-      createChart();
-    }
-  }, [data])
+    createChart();
+  }, [])
 
   return (
     <div id="Chart5" style={{ width: "100%", height: "80%" }}></div>
 
client/views/component/chart/Chart7.jsx (added)
+++ client/views/component/chart/Chart7.jsx
@@ -0,0 +1,256 @@
+import React, { Component } from "react";
+import * as am5 from "@amcharts/amcharts5";
+import * as am5xy from "@amcharts/amcharts5/xy";
+import am5themes_Animated from "@amcharts/amcharts5/themes/Animated";
+
+class Chart6 extends Component {
+  componentDidMount() {
+    am5.ready(function () {
+
+      // Create root element
+      // https://www.amcharts.com/docs/v5/getting-started/#Root_element
+      var root = am5.Root.new("chart7");
+
+      // Set themes
+      // https://www.amcharts.com/docs/v5/concepts/themes/
+      root.setThemes([
+        am5themes_Animated.new(root)
+      ]);
+
+      // Create chart
+      // https://www.amcharts.com/docs/v5/charts/xy-chart/
+      var chart = root.container.children.push(
+        am5xy.XYChart.new(root, {
+          panX: false,
+          panY: false,
+          wheelX: "panX",
+          wheelY: "zoomX",
+          layout: root.verticalLayout,
+          arrangeTooltips: false
+        })
+      );
+
+      // Use only absolute numbers
+      chart.getNumberFormatter().set("numberFormat", "#.#s");
+
+      // Add legend
+      // https://www.amcharts.com/docs/v5/charts/xy-chart/legend-xy-series/
+      var legend = chart.children.push(
+        am5.Legend.new(root, {
+          centerX: am5.p50,
+          x: am5.p50
+        })
+      );
+
+      // Data
+      var data = [
+        {
+          age: "85+",
+          male: -0.1,
+          female: 0.3
+        },
+        {
+          age: "80-54",
+          male: -0.2,
+          female: 0.3
+        },
+        {
+          age: "75-79",
+          male: -0.3,
+          female: 0.6
+        },
+        {
+          age: "70-74",
+          male: -0.5,
+          female: 0.8
+        },
+        {
+          age: "65-69",
+          male: -0.8,
+          female: 1.0
+        },
+        {
+          age: "60-64",
+          male: -1.1,
+          female: 1.3
+        },
+        {
+          age: "55-59",
+          male: -1.7,
+          female: 1.9
+        },
+        {
+          age: "50-54",
+          male: -2.2,
+          female: 2.5
+        },
+        {
+          age: "45-49",
+          male: -2.8,
+          female: 3.0
+        },
+        {
+          age: "40-44",
+          male: -3.4,
+          female: 3.6
+        },
+        {
+          age: "35-39",
+          male: -4.2,
+          female: 4.1
+        },
+        {
+          age: "30-34",
+          male: -5.2,
+          female: 4.8
+        },
+        {
+          age: "25-29",
+          male: -5.6,
+          female: 5.1
+        },
+        {
+          age: "20-24",
+          male: -5.1,
+          female: 5.1
+        },
+        {
+          age: "15-19",
+          male: -3.8,
+          female: 3.8
+        },
+        {
+          age: "10-14",
+          male: -3.2,
+          female: 3.4
+        },
+        {
+          age: "5-9",
+          male: -4.4,
+          female: 4.1
+        },
+        {
+          age: "0-4",
+          male: -5.0,
+          female: 4.8
+        }
+      ];
+
+      // Create axes
+      // https://www.amcharts.com/docs/v5/charts/xy-chart/axes/
+      var yAxis = chart.yAxes.push(
+        am5xy.CategoryAxis.new(root, {
+          categoryField: "age",
+          renderer: am5xy.AxisRendererY.new(root, {
+            inversed: true,
+            cellStartLocation: 0.1,
+            cellEndLocation: 0.9
+          })
+        })
+      );
+
+      yAxis.data.setAll(data);
+
+      var xAxis = chart.xAxes.push(
+        am5xy.ValueAxis.new(root, {
+          renderer: am5xy.AxisRendererX.new(root, {
+            strokeOpacity: 0.1
+          })
+        })
+      );
+
+      // Add series
+      // https://www.amcharts.com/docs/v5/charts/xy-chart/series/
+      function createSeries(field, labelCenterX, pointerOrientation, rangeValue) {
+        var series = chart.series.push(
+          am5xy.ColumnSeries.new(root, {
+            xAxis: xAxis,
+            yAxis: yAxis,
+            valueXField: field,
+            categoryYField: "age",
+            sequencedInterpolation: true,
+            clustered: false,
+            tooltip: am5.Tooltip.new(root, {
+              pointerOrientation: pointerOrientation,
+              labelText: "{categoryY}: {valueX}"
+            })
+          })
+        );
+
+        series.columns.template.setAll({
+          height: am5.p100,
+          strokeOpacity: 0,
+          fillOpacity: 0.8
+        });
+
+        series.bullets.push(function () {
+          return am5.Bullet.new(root, {
+            locationX: 1,
+            locationY: 0.5,
+            sprite: am5.Label.new(root, {
+              centerY: am5.p50,
+              text: "{valueX}",
+              populateText: true,
+              centerX: labelCenterX
+            })
+          });
+        });
+
+        series.data.setAll(data);
+        series.appear();
+
+        var rangeDataItem = xAxis.makeDataItem({
+          value: rangeValue
+        });
+        xAxis.createAxisRange(rangeDataItem);
+        rangeDataItem.get("grid").setAll({
+          strokeOpacity: 1,
+          stroke: series.get("stroke")
+        });
+
+        var label = rangeDataItem.get("label");
+        label.setAll({
+          text: field.toUpperCase(),
+          fontSize: "1.1em",
+          fill: series.get("stroke"),
+          paddingTop: 10,
+          isMeasured: false,
+          centerX: labelCenterX
+        });
+        label.adapters.add("dy", function () {
+          return -chart.plotContainer.height();
+        });
+
+        return series;
+      }
+
+      createSeries("male", am5.p100, "right", -3);
+      createSeries("female", 0, "left", 4);
+
+      // Add cursor
+      // https://www.amcharts.com/docs/v5/charts/xy-chart/cursor/
+      var cursor = chart.set("cursor", am5xy.XYCursor.new(root, {
+        behavior: "zoomY"
+      }));
+      cursor.lineY.set("forceHidden", true);
+      cursor.lineX.set("forceHidden", true);
+
+      // Make stuff animate on load
+      // https://www.amcharts.com/docs/v5/concepts/animations/
+      chart.appear(1000, 100);
+
+    }); // end am5.ready()
+  }
+
+  componentWillUnmount() {
+    if (this.root) {
+      this.root.dispose();
+    }
+  }
+
+  render() {
+    return <div id="chart7" style={{ width: "100%", height: "100%" }}></div>;
+  }
+}
+
+export default Chart6;
client/views/layout/Menu.jsx
--- client/views/layout/Menu.jsx
+++ client/views/layout/Menu.jsx
@@ -50,9 +50,13 @@
         <h1 className="logo"><img src={logo} alt="" /></h1>
         <div className="flex-align-column" style={{ marginTop: `3rem` }}>
           <ul >
-            {items.map((item, index) => (
-              <SidebarItem key={index} item={item} />
-            ))}
+            {
+              items != null ? (
+                items.map((item, index) => (
+                  <SidebarItem key={index} item={item} />
+                ))
+              ) : null
+            }
           </ul>
         </div>
         <div className="bottom-section flex-center" style={{width: '100%'}}>
client/views/pages/App.jsx
--- client/views/pages/App.jsx
+++ client/views/pages/App.jsx
@@ -17,6 +17,7 @@
 import Header from "../layout/Header.jsx";
 import Menu from "../layout/Menu.jsx";
 import Login from "./login/Login.jsx";
+import PasswordChange from "./main/PasswordChange.jsx";
 import Weather from "./main/Weather.jsx";
 import CommonUtil from "../../resources/js/CommonUtil.js";
 
@@ -140,6 +141,8 @@
 
   //로그인 여부
   const [isLogin, setIsLogin] = React.useState(false);
+  //기본 비밀번호 사용 여부 확인 (로그인 여부 확인 후, 사용 바람)
+  const [isDefaultPassword, setIsDefaultPassword] = React.useState(false);
   
   //로그인에 따라 각기 다른 App 주입 대상 변수(AdminApp, GovernmentApp, AgencyApp, GuardianApp)
   const [appRoute, setAppRoute] = React.useState(null);
@@ -153,14 +156,35 @@
         'Content-Type': 'application/json; charset=UTF-8'
       },
       body: JSON.stringify({}),
-    }).then((response) => response.json()).then((data) => {
-      console.log("로그인 결과 : ", data);
+    }).then((response) => response.json()).then((loginUser) => {
+      console.log("로그인 결과 : ", loginUser);
       //로그인 사용자 정보 전역 변수에 저장
-      dispatch(setLoginUser(data));
-      //클라이언트 로그인 체크 (콜백)
-      if (CommonUtil.isEmpty(clientLoginCheck) == false) {
-        clientLoginCheck(data);
-      }
+      dispatch(setLoginUser(loginUser));
+
+      //로그인 유무(로그인 정보가 있으면 True, 없으면 False)
+      let isLogin = (loginUser != null && loginUser['user_id'] != null);
+      setIsLogin(isLogin);
+
+      //기본 비밀번호 사용 여부 확인
+      fetch("/user/isDefaultPassword.json", {
+        method: "POST",
+        headers: {
+          'Content-Type': 'application/json; charset=UTF-8'
+        },
+        body: JSON.stringify({}),
+      }).then((response) => response.json()).then((isDefaultPassword) => {
+        console.log("기본 비밀번호 사용 여부 확인 결과 : ", isDefaultPassword);
+        setIsDefaultPassword(isDefaultPassword);
+
+        //클라이언트 로그인 체크 (콜백)
+        if (CommonUtil.isEmpty(clientLoginCheck) == false) {
+          clientLoginCheck(loginUser, isLogin);
+        }
+
+      }).catch((error) => {
+        console.log('login() /user/isDefaultPassword.json error : ', error);
+      });
+
     }).catch((error) => {
       console.log('login() /user/loginUserSelectOne.json error : ', error);
     });
@@ -219,13 +243,9 @@
 
   //URL 변경 시, 발생 이벤트(hook)
   React.useEffect(() => {
-    loginUserSelectOne((loginResultData) => {
+    loginUserSelectOne((loginResultData, isLogin) => {
       //console.log('loginResultData : ', loginResultData);
       //console.log('isLogin : ', isLogin, ', authority : ', loginResultData['authority']);
-
-      //로그인 유무(로그인 정보가 있으면 True, 없으면 False)
-      let isLogin = (loginResultData != null && loginResultData['user_id'] != null);
-      setIsLogin(isLogin);
 
       //로그인 -> 권한에 따른 App 주입 
       if (isLogin == true) {
@@ -271,15 +291,17 @@
 
   return (
     <div id="App">
-      {isLogin == true ? (
-        <div id="layout">
-          <Header/>
-          <Menu items={menuItems != null ? menuItems : null}/>
-          <div id="pages">
-            {appRoute != null ? appRoute : null}
+      {isLogin == true ?
+        isDefaultPassword == false ? (
+          <div id="layout">
+            <Header/>
+            <Menu items={menuItems != null ? menuItems : null}/>
+            <div id="pages">
+              {appRoute != null ? appRoute : null}
+            </div>
           </div>
-        </div>
-      ) : (<Login/>)}
+        ) : (<PasswordChange/>)
+      : (<Login/>)}
     </div>
   );
 }
client/views/pages/callcenter/QandAInsert.jsx
--- client/views/pages/callcenter/QandAInsert.jsx
+++ client/views/pages/callcenter/QandAInsert.jsx
@@ -14,7 +14,7 @@
   const location = useLocation();
 
   //전역 변수 저장 객체
-  const state = useSelector((state) => {return state});
+  const state = useSelector((state) => { return state });
   const defaultGovernmentId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['government_id'];
   const defaultAgencyId = CommonUtil.isEmpty(state.loginUser) ? null : state.loginUser['agency_id'];
   let defaultSeniorId = null;
@@ -28,430 +28,456 @@
     defaultSeniorId = null;
   }
 
-  console.log('defaultSeniorId : ', defaultSeniorId);
+  const [seniorSearch, setSeniorSearch] = React.useState(defaultSeniorId);
 
-	// 시스템 코드 - 장비 상태
-	const [equipmentStates, setEquipmentStates] = React.useState({});
-	// 시스템 코드 - 장비 상태 조회
-	const equipmentStatesSelect = () => {
-		console.log('equipmentStatesSelect Function Run');
+  // 시스템 코드 - 장비 상태
+  const [equipmentStates, setEquipmentStates] = React.useState({});
+  // 시스템 코드 - 장비 상태 조회
+  const equipmentStatesSelect = () => {
+    console.log('equipmentStatesSelect Function Run');
 
-		//fetch post
-		fetch("/common/systemCode/equipmentStatesSelect.json", {
-			method: "POST",
-			headers: {
-				'Content-Type': 'application/json; charset=UTF-8'
-			},
-			body: JSON.stringify({})
-		}).then((response) => response.json()).then((data) => {
-			console.log('equipmentStatesSelect response : ', data);
-			setEquipmentStates(data);
-		}).catch((error) => {
-			console.log('equipmentStatesSelect error : ', error);
-		});
-	}
-	
-
-	//입고 및 미대여 장비 검색 정보
-	const [equipmentSearch, setEquipmentSearch] = React.useState({
-		'government_id': defaultGovernmentId,
-		'agency_id': defaultAgencyId,
-		'senior_id': defaultSeniorId,
-		'currentPage': 1,
-		'perPage': 10,
-		'searchType': null,
-		'searchText': null,
-
-		'equipment_state': null,
-	});
-	//장비 정보 변경
-	const equipmentSearchChange = (targetKey, value) => {
-		equipmentSearch[targetKey] = value;
-		setEquipmentSearch({...equipmentSearch});
-	}
-	//장비 검색
-	const equipmentSearching = () => {
-		equipmentSelectList(1);
-	}
-	const equipmentSearchingEnter = (key) => {
-		if (key == 'Enter') {
-			equipmentSearching();
-		} else {
-			return;
-		}
-	}
-	//입고 및 미대여 목록
-	const [equipment, setEquipment] = React.useState({equipmentList: [], equipmentListCount: 0});
-	//입고 및 미대여 목록 조회
-	const equipmentSelectList = (currentPage) => {
-		equipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
-		setEquipmentSearch({...equipmentSearch});
-
-		fetch("/equipment/equipmentSelectList.json", {
-			method: "POST",
-			headers: {
-				'Content-Type': 'application/json; charset=UTF-8'
-			},
-			body: JSON.stringify(equipmentSearch)
-		}).then((response) => response.json()).then((data) => {
-			console.log('equipmentSelectList response : ', data);
-			setEquipment(data);
-			if (CommonUtil.isEmpty(data.equipmentList) == false && equipmentInquiry['equipment_serial_number'] == '') {
-				equipmentInquirySelect(data.equipmentList[0]);
-			}
-		}).catch((error) => {
-			console.log('equipmentSelectList error : ', error);
-		});
-	}
-
-	//장비 모달 여부
-	const [modalEquipmentIsOpen, setModalEquipmentIsOpen] = React.useState(false);
-	//장비 오픈
-	const modalEquipmentOpen = () => {
-		setModalEquipmentIsOpen(true);
-	};
-	//장비 닫기
-	const modalEquipmentClose = () => {
-		setModalEquipmentIsOpen(false);
-	};
-
-	const equipmentInit = {
-		'equipment_serial_number': null,
-		'equipment_name': null,
-		'agency_name': null,
-		'rental_detail_insert_user_name': null,
-		'rental_detail_insert_user_id': null,
-		'user_name': null,
-		'user_id': null,
-		'user_address': null,
-		'equipment_state': null,
-	}
-	//등록할 문의 정보
-	const [equipmentInquiry, setEquipmentInquiry] = React.useState({
-        'inquiry_idx': 0,
-        'inquiry_type': null,
-        'inquiry_title': null,
-        'inquiry_content': null,
-        'inquiry_state': null,
-        'inquiry_insert_user_id': null,
-        'inquiry_insert_datetime': null,
-        'inquiry_answer_content': null,
-        'inquiry_answer_user_id': null,
-        'inquiry_update_datetime': null,
-
-		'equipment_serial_number': null,
-		//문의할 장비 정보
-		equipment: {...equipmentInit}
+    //fetch post
+    fetch("/common/systemCode/equipmentStatesSelect.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify({})
+    }).then((response) => response.json()).then((data) => {
+      console.log('equipmentStatesSelect response : ', data);
+      setEquipmentStates(data);
+    }).catch((error) => {
+      console.log('equipmentStatesSelect error : ', error);
     });
-	const equipmentInquiryRef = React.useRef({...equipmentInquiry});
-
-	//문의할 장비 선택
-	const equipmentInquirySelect = (equipment) => {
-		equipmentInquiry.equipment = equipment;
-		equipmentInquiry['equipment_serial_number'] = equipment['equipment_serial_number'];
-		setEquipmentInquiry({...equipmentInquiry});
-	}
-
-	//문의할 장비 선택 취소
-	const equipmentInquirySelectCancel = () => {
-		equipmentInquiry['equipment_serial_number'] = '';
-		equipmentInquiry.equipment = {...equipmentInit};
-		
-		setEquipmentInquiry({...equipmentInquiry});
-	}
-
-	//등록할 문의 구분이 '장비문의'로 바꼈을 때만 작동
-	React.useEffect(() => {
-		if (equipmentInquiry['equipment_serial_number'] == '') {
-			equipmentInquiry['inquiry_type'] = '기타';
-			setEquipmentInquiry({...equipmentInquiry});
-		} else if (equipmentInquiry['equipment_serial_number'] == null) {
-			equipmentInquiry.equipment = {...equipmentInit};
-			equipmentInquiry['inquiry_type'] = null;
-			setEquipmentInquiry({...equipmentInquiry});
-		}
-	}, [equipmentInquiry['equipment_serial_number']]);
-
-	//등록할 문의 구분이 '장비문의 구분'이 바꼈을 때만 작동
-	React.useEffect(() => {
-		if (equipmentInquiry['equipment_serial_number'] == ''
-			&& (equipmentInquiry['inquiry_type'] == '교환'
-				|| equipmentInquiry['inquiry_type'] == '수리')) {
-			equipmentSelectList(1);
-		} else if (CommonUtil.isEmpty(equipmentInquiry['equipment_serial_number']) == false
-					&& equipmentInquiry['inquiry_type'] == '추가') {
-			equipmentInquirySelectCancel();
-		}
-	}, [equipmentInquiry['inquiry_type']]);
+  }
 
 
-	//문의 등록 유효성 검사
-	const equipmentInquiryValidation = () => {
-		const target = equipmentInquiry;
-		const targetRef = equipmentInquiryRef;
-		if (CommonUtil.isEmpty(target['inquiry_title']) == true) {
-			targetRef.current['inquiry_title'].focus();
-			alert("문의제목을 입력해 주세요.");
-			return false;
-		}
-		if (CommonUtil.isEmpty(target['inquiry_content']) == true) {
-			targetRef.current['inquiry_content'].focus();
-			alert("내용을 입력해 주세요.");
-			return false;
-		}
-		if ((equipmentInquiry['inquiry_type'] == '교환' || equipmentInquiry['inquiry_type'] == '수리')
-			&& CommonUtil.isEmpty(target['equipment_serial_number'])) {
-			alert(`장비 ${equipmentInquiry['inquiry_type']}은(는) 장비 정보를 필수로 선택하셔야 됩니다.`);
-			return false;
-		}
+  //입고 및 미대여 장비 검색 정보
+  const [equipmentSearch, setEquipmentSearch] = React.useState({
+    'government_id': defaultGovernmentId,
+    'agency_id': defaultAgencyId,
+    'senior_id': seniorSearch,
+    'currentPage': 1,
+    'perPage': 10,
+    'searchType': null,
+    'searchText': null,
 
-		return true;
-	}
+    'equipment_state': null,
+  });
+  //장비 정보 변경
+  const equipmentSearchChange = (targetKey, value) => {
+    equipmentSearch[targetKey] = value;
+    setEquipmentSearch({ ...equipmentSearch });
+  }
+  //장비 검색
+  const equipmentSearching = () => {
+    equipmentSelectList(1);
+  }
+  const equipmentSearchingEnter = (key) => {
+    if (key == 'Enter') {
+      equipmentSearching();
+    } else {
+      return;
+    }
+  }
+  //입고 및 미대여 목록
+  const [equipment, setEquipment] = React.useState({ equipmentList: [], equipmentListCount: 0 });
+  //입고 및 미대여 목록 조회
+  const equipmentSelectList = (currentPage) => {
+    equipmentSearch.currentPage = CommonUtil.isEmpty(currentPage) ? 1 : currentPage;
+    setEquipmentSearch({ ...equipmentSearch });
 
-	//문의 등록
-	const equipmentInquiryInsert = () => {
-		if (equipmentInquiryValidation() == false) {
-			return;
-		}
+    fetch("/equipment/equipmentSelectList.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(equipmentSearch)
+    }).then((response) => response.json()).then((data) => {
+      console.log('equipmentSelectList response : ', data);
+      setEquipment(data);
+      if (CommonUtil.isEmpty(data.equipmentList) == false && equipmentInquiry['equipment_serial_number'] == '') {
+        equipmentInquirySelect(data.equipmentList[0]);
+      }
+    }).catch((error) => {
+      console.log('equipmentSelectList error : ', error);
+    });
+  }
 
-		if (equipmentInquiry['equipment_serial_number'] == '') {
-			equipmentInquiry['equipment_serial_number'] = null;
-		}
+  //장비 모달 여부
+  const [modalEquipmentIsOpen, setModalEquipmentIsOpen] = React.useState(false);
+  //장비 오픈
+  const modalEquipmentOpen = () => {
+    setModalEquipmentIsOpen(true);
+  };
+  //장비 닫기
+  const modalEquipmentClose = () => {
+    setModalEquipmentIsOpen(false);
+  };
 
-		fetch("/equipment/equipmentInquiryInsert.json", {
-			method: "POST",
-			headers: {
-				'Content-Type': 'application/json; charset=UTF-8'
-			},
-			body: JSON.stringify(equipmentInquiry),
-		}).then((response) => response.json()).then((data) => {
-			console.log("문의 등록 결과(건수) : ", data);
-			if (data > 0) {
-				alert("등록완료");
-				navigate('/QandASelect');
-			} else {
-				alert("등록에 실패하였습니다. 관리자에게 문의바랍니다.");
-			}
-		}).catch((error) => {
-			console.log('equipmentInquiryInsert() /equipment/equipmentInquiryInsert.json error : ', error);
-		});
-	}
+  const equipmentInit = {
+    'equipment_serial_number': null,
+    'equipment_name': null,
+    'agency_name': null,
+    'rental_detail_insert_user_name': null,
+    'rental_detail_insert_user_id': null,
+    'user_name': null,
+    'user_id': null,
+    'user_address': null,
+    'equipment_state': null,
+  }
+  //등록할 문의 정보
+  const [equipmentInquiry, setEquipmentInquiry] = React.useState({
+    'inquiry_idx': 0,
+    'inquiry_type': null,
+    'inquiry_title': null,
+    'inquiry_content': null,
+    'inquiry_state': null,
+    'inquiry_insert_user_id': null,
+    'inquiry_insert_datetime': null,
+    'inquiry_answer_content': null,
+    'inquiry_answer_user_id': null,
+    'inquiry_update_datetime': null,
+
+    'equipment_serial_number': null,
+    //문의할 장비 정보
+    equipment: { ...equipmentInit }
+  });
+  const equipmentInquiryRef = React.useRef({ ...equipmentInquiry });
+
+  //문의할 장비 선택
+  const equipmentInquirySelect = (equipment) => {
+    equipmentInquiry.equipment = equipment;
+    equipmentInquiry['equipment_serial_number'] = equipment['equipment_serial_number'];
+    setEquipmentInquiry({ ...equipmentInquiry });
+  }
+
+  //문의할 장비 선택 취소
+  const equipmentInquirySelectCancel = () => {
+    equipmentInquiry['equipment_serial_number'] = '';
+    equipmentInquiry.equipment = { ...equipmentInit };
+
+    setEquipmentInquiry({ ...equipmentInquiry });
+  }
+
+  //등록할 문의 구분이 '장비문의'로 바꼈을 때만 작동
+  React.useEffect(() => {
+    if (equipmentInquiry['equipment_serial_number'] == '') {
+      equipmentInquiry['inquiry_type'] = '기타';
+      setEquipmentInquiry({ ...equipmentInquiry });
+    } else if (equipmentInquiry['equipment_serial_number'] == null) {
+      equipmentInquiry.equipment = { ...equipmentInit };
+      equipmentInquiry['inquiry_type'] = null;
+      setEquipmentInquiry({ ...equipmentInquiry });
+    }
+  }, [equipmentInquiry['equipment_serial_number']]);
+
+  //등록할 문의 구분이 '장비문의 구분'이 바꼈을 때만 작동
+  React.useEffect(() => {
+    if (equipmentInquiry['equipment_serial_number'] == ''
+      && (equipmentInquiry['inquiry_type'] == '교환'
+        || equipmentInquiry['inquiry_type'] == '수리')) {
+      equipmentSelectList(1);
+    } else if (CommonUtil.isEmpty(equipmentInquiry['equipment_serial_number']) == false
+      && equipmentInquiry['inquiry_type'] == '추가') {
+      equipmentInquirySelectCancel();
+    }
+  }, [equipmentInquiry['inquiry_type']]);
 
 
+  //문의 등록 유효성 검사
+  const equipmentInquiryValidation = () => {
+    const target = equipmentInquiry;
+    const targetRef = equipmentInquiryRef;
+    if (CommonUtil.isEmpty(target['inquiry_title']) == true) {
+      targetRef.current['inquiry_title'].focus();
+      alert("문의제목을 입력해 주세요.");
+      return false;
+    }
+    if (CommonUtil.isEmpty(target['inquiry_content']) == true) {
+      targetRef.current['inquiry_content'].focus();
+      alert("내용을 입력해 주세요.");
+      return false;
+    }
+    if ((equipmentInquiry['inquiry_type'] == '교환' || equipmentInquiry['inquiry_type'] == '수리')
+      && CommonUtil.isEmpty(target['equipment_serial_number'])) {
+      alert(`장비 ${equipmentInquiry['inquiry_type']}은(는) 장비 정보를 필수로 선택하셔야 됩니다.`);
+      return false;
+    }
 
-	React.useEffect(() => {
-		equipmentStatesSelect();
-	}, [])
+    return true;
+  }
+
+  //문의 등록
+  const equipmentInquiryInsert = () => {
+    if (equipmentInquiryValidation() == false) {
+      return;
+    }
+
+    if (equipmentInquiry['equipment_serial_number'] == '') {
+      equipmentInquiry['equipment_serial_number'] = null;
+    }
+
+    fetch("/equipment/equipmentInquiryInsert.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(equipmentInquiry),
+    }).then((response) => response.json()).then((data) => {
+      console.log("문의 등록 결과(건수) : ", data);
+      if (data > 0) {
+        alert("등록완료");
+        navigate('/QandASelect');
+      } else {
+        alert("등록에 실패하였습니다. 관리자에게 문의바랍니다.");
+      }
+    }).catch((error) => {
+      console.log('equipmentInquiryInsert() /equipment/equipmentInquiryInsert.json error : ', error);
+    });
+  }
+
+  React.useEffect(() => {
+    equipmentStatesSelect();
+  }, [seniorSearch])
 
   return (
     <main>
-		
-		<Modal open={modalEquipmentIsOpen} close={modalEquipmentClose} header="문의대상 장비 선택">
-			<div className="board-wrap">
-				<div>
-					
-					<div className="search-management flex-end margin-bottom2 margin-top gap">						
-						<select style={{maxWidth: '150px'}}
-							onChange={(e) => equipmentSearchChange('equipment_state', e.target.value)}>
-							<option value="">상태</option>
-							{Object.keys(equipmentStates).map((key, idx) => { return ( 
-								<option key={key} value={key}>
-									{equipmentStates[key]}
-								</option>
-							)})}
-						</select>
-						<select style={{maxWidth: '150px'}}
-							onChange={(e) => equipmentSearchChange('searchType', e.target.value)}>
-							<option value="">전체</option>
-							<option value="equipment_name">모델명</option>
-							<option value="equipment_serial_number">시리얼넘버</option>
-						</select>
-						<input type="text"
-							value={equipmentSearch.searchText}
-							onChange={(e) => equipmentSearchChange('searchText', e.target.value)}
-							onKeyUp={(e) => equipmentSearchingEnter(e.key)}
-						/>
-						<button className={"btn-small gray-btn"} style={{maxWidth: '150px'}} onClick={equipmentSearching}>검색</button>
-					</div>
 
-					<table class="caregiver-user protector-user">
-						<thead>
-							<tr>
-								<th>No</th>
-								<th>장비사용대상자</th>
-								<th>모델명</th>
-								<th>시리얼넘버</th>
-								<th>장비상태</th>
-								<th>기관</th>
-								<th>선택</th>
-							</tr>
-						</thead>
-						<tbody>
-							{equipment.equipmentList.map((item, idx) => { return (
-							<tr>
-								<td data-label="No">{equipment.equipmentListCount - idx - (equipmentSearch.currentPage - 1) * equipmentSearch.perPage}</td>
-								<td data-label="장비사용대상자">
-									{item['user_id'] == null ? '미대여' : item['user_name']}
-								</td>
-								<td data-label="모델명">{item['equipment_name']}</td>
-								<td data-label="시리얼넘버">{item['equipment_serial_number']}</td>
-								<td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td>
-								<td>
-									{item['agency_id'] == null ? item['government_name'] : item['agency_name']}
-								</td>
-								<td data-label="대여시행자">
-									{equipmentInquiry.equipment['equipment_serial_number'] != item['equipment_serial_number']
-										? <button className={"btn-small gray-btn"} style={{maxWidth: '150px'}}
-										onClick={() => {equipmentInquirySelect(item); modalEquipmentClose();}}>선택</button>
-										: <button className={"btn-small red-btn"} style={{maxWidth: '150px'}}
-										onClick={() => {equipmentInquirySelectCancel(); modalEquipmentClose();}}>취소</button>
-									}
-								</td>
-							</tr>
-							)})}
-							{CommonUtil.isEmpty(equipment.equipmentList) ?
-							<tr>
-								<td colSpan={7}>조회된 데이터가 없습니다</td>
-							</tr>
-							: null}
-						</tbody>
-					</table>
-					<Pagination
-						currentPage={equipmentSearch.currentPage}
-						perPage={equipmentSearch.perPage}
-						totalCount={equipment.equipmentListCount}
-						maxRange={5}
-						click={equipmentSelectList}
-					/>
-				</div>
-			</div>
-		</Modal>
+      <Modal open={modalEquipmentIsOpen} close={modalEquipmentClose} header="문의대상 장비 선택">
+        <div className="board-wrap">
+          <div>
 
-		<div className="content-wrap row">
-			<ContentTitle contentTitle={"문의글 작성"} className={"margin-bottom2"} />
-			<SubTitle explanation={"문의 정보"} className={"margin-bottom2"}/>
-			<table className="margin-bottom2 qna-insert senior-detail">
-				<tr>
-					<th><span style={{color : "red"}}>*</span>구분</th>
-					<td colSpan={3}>
-						<div className="gender flex-start gap5">
-							<div className="flex-start">
-								<input type="radio" id="normal_question" name="question_type" value="일반문의" style={{width: '25px'}}
-									checked={equipmentInquiry['equipment_serial_number'] == null}
-									onChange={(e) => {equipmentInquiry['equipment_serial_number'] = null; setEquipmentInquiry({...equipmentInquiry});}}/>
-								<label for="normal_question">일반문의</label>
-							</div>
-							<div className="flex-start">
-								<input type="radio" id="equipment_question" name="question_type" value="장비문의" style={{width: '25px'}}
-									checked={equipmentInquiry['equipment_serial_number'] != null}
-									onChange={(e) => {equipmentInquiry['equipment_serial_number'] = ''; setEquipmentInquiry({...equipmentInquiry});}}/>
-								<label for="equipment_question" >장비문의</label>
-							</div>
-						</div>
-					</td>
-				</tr>
-				{equipmentInquiry['equipment_serial_number'] != null ?
-				<tr>
-					<th><span style={{color : "red"}}>*</span>장비문의 구분</th>
-					<td colSpan={3}>
-						<select onChange={(e) => {equipmentInquiry['inquiry_type'] = e.target.value; setEquipmentInquiry({...equipmentInquiry});}}>
-							<option selected={equipmentInquiry['inquiry_type'] == '수리'}>수리</option>
-							<option selected={equipmentInquiry['inquiry_type'] == '교환'}>교환</option>
-							<option selected={equipmentInquiry['inquiry_type'] == '추가'}>추가</option>
-							<option selected={equipmentInquiry['inquiry_type'] == '기타'}>기타</option>
-						</select>
-					</td>
-				</tr>
-				: null}
-				<tr>
-					<th><span style={{color : "red"}}>*</span>문의제목</th>
-					<td colSpan={3}>
-						<input type="text" placeholder="문의글의 제목을 입력해주세요."
-							onChange={(e) => {equipmentInquiry['inquiry_title'] = e.target.value; setEquipmentInquiry({...equipmentInquiry});}}
-							ref={el => equipmentInquiryRef.current['inquiry_title'] = el}
-						/>
-					</td>
-				</tr>
-				<tr>
-					<th><span style={{color : "red"}}>*</span>내용</th>
-					<td colSpan={3}>
-						<textarea className="medicine" cols="30" rows="2"
-							onChange={(e) => {equipmentInquiry['inquiry_content'] = e.target.value; setEquipmentInquiry({...equipmentInquiry});}}
-							ref={el => equipmentInquiryRef.current['inquiry_content'] = el}
-						></textarea>
-					</td>
-				</tr>
-			</table>
-			
-			{equipmentInquiry['equipment_serial_number'] != null
-			?<>
-				<SubTitle explanation={equipmentInquiry['inquiry_type'] == '교환' || equipmentInquiry['inquiry_type'] == '수리'
-					? <span>장비 정보 <span style={{color : "red"}}>(필수)</span></span>
-					: <span>장비 정보 (선택)</span>
-				} className={"display-inline-block margin-bottom2"}/>
-				<button className={"btn-small gray-btn"} style={{maxWidth: '150px'}} onClick={() => {equipmentSelectList(1); modalEquipmentOpen();}}>검색</button>
-				{CommonUtil.isEmpty(equipmentInquiry.equipment['equipment_serial_number']) == false ?
-				<>
-					<button className={"btn-small red-btn"} style={{maxWidth: '150px'}} onClick={equipmentInquirySelectCancel}>취소</button>
-					<table className="margin-bottom2 qna-insert senior-detail">
-						<tr>
-							<th>장비 시리얼넘버</th>
-							<td colSpan={3}>
-								{equipmentInquiry.equipment['equipment_serial_number']} 
-							</td>
-						</tr>
-						<tr>
-							<th>모델명</th>
-							<td>
-								{equipmentInquiry.equipment['equipment_name']}
-							</td>
-							<th>장비상태</th>
-							<td>
-								{equipmentStates[equipmentInquiry.equipment['equipment_state']]}
-							</td>
-						</tr>
-						<tr>
-							<th>소속기관</th>
-							<td>
-								{equipmentInquiry.equipment['agency_id'] == null ? equipmentInquiry.equipment['government_name'] : equipmentInquiry.equipment['agency_name']}
-							</td>
-							<th>대여시행자</th>
-							<td>
-								{CommonUtil.isEmpty(equipmentInquiry.equipment['equipment_serial_number']) == false
-								&& CommonUtil.isEmpty(equipmentInquiry.equipment['rental_detail_insert_user_id']) == false
-									? <>
-										{equipmentInquiry.equipment['rental_detail_insert_user_name']}
-										({equipmentInquiry.equipment['rental_detail_insert_user_id']})
-									</>
-								: '미대여'}
-							</td>
-						</tr>
-						<tr>
-							<th>장비사용대상자</th>
-							<td>
-								{equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_name']}
-							</td>
-							<th>대상자 ID</th>
-							<td>
-								{equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_id']}
-							</td>
-						</tr>
-						<tr>
-							<th>대상자 주소</th>
-							<td colSpan={3}>
-								{equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_address']}
-							</td>
-						</tr>
-					</table>
-				</>: null}
-			</>: null}
-		
-			<div className="btn-wrap flex-center margin-top5">
-				<button className="btn-large gray-btn" onClick={() => navigate(-1)}>취소</button>
-				<button className="btn-large red-btn" onClick={() => equipmentInquiryInsert()}>등록</button>
-			</div>
+            <div className="search-management flex-end margin-bottom2 margin-top gap">
+              <select style={{ maxWidth: '150px' }}
+                onChange={(e) => equipmentSearchChange('equipment_state', e.target.value)}>
+                <option value="">상태</option>
+                {Object.keys(equipmentStates).map((key, idx) => {
+                  return (
+                    <option key={key} value={key}>
+                      {equipmentStates[key]}
+                    </option>
+                  )
+                })}
+              </select>
+              <select style={{ maxWidth: '150px' }}
+                onChange={(e) => equipmentSearchChange('searchType', e.target.value)}>
+                <option value="">전체</option>
+                <option value="equipment_name">모델명</option>
+                <option value="equipment_serial_number">시리얼넘버</option>
+              </select>
+              <input type="text"
+                value={equipmentSearch.searchText}
+                onChange={(e) => equipmentSearchChange('searchText', e.target.value)}
+                onKeyUp={(e) => equipmentSearchingEnter(e.key)}
+              />
+              <button className={"btn-small gray-btn"} style={{ maxWidth: '150px' }} onClick={equipmentSearching}>검색</button>
+            </div>
 
-		</div>
-	</main>
+            <table class="caregiver-user protector-user">
+              <thead>
+                <tr>
+                  <th>No</th>
+                  <th>장비사용대상자</th>
+                  <th>모델명</th>
+                  <th>시리얼넘버</th>
+                  <th>장비상태</th>
+                  <th>기관</th>
+                  <th>선택</th>
+                </tr>
+              </thead>
+              <tbody>
+                {equipment.equipmentList.map((item, idx) => {
+                  return (
+                    <tr>
+                      <td data-label="No">{equipment.equipmentListCount - idx - (equipmentSearch.currentPage - 1) * equipmentSearch.perPage}</td>
+                      <td data-label="장비사용대상자">
+                        {item['user_id'] == null ? '미대여' : item['user_name']}
+                      </td>
+                      <td data-label="모델명">{item['equipment_name']}</td>
+                      <td data-label="시리얼넘버">{item['equipment_serial_number']}</td>
+                      <td data-label="장비상태">{equipmentStates[item['equipment_state']]}</td>
+                      <td>
+                        {item['agency_id'] == null ? item['government_name'] : item['agency_name']}
+                      </td>
+                      <td data-label="대여시행자">
+                        {equipmentInquiry.equipment['equipment_serial_number'] != item['equipment_serial_number']
+                          ? <button className={"btn-small gray-btn"} style={{ maxWidth: '150px' }}
+                            onClick={() => { equipmentInquirySelect(item); modalEquipmentClose(); }}>선택</button>
+                          : <button className={"btn-small red-btn"} style={{ maxWidth: '150px' }}
+                            onClick={() => { equipmentInquirySelectCancel(); modalEquipmentClose(); }}>취소</button>
+                        }
+                      </td>
+                    </tr>
+                  )
+                })}
+                {CommonUtil.isEmpty(equipment.equipmentList) ?
+                  <tr>
+                    <td colSpan={7}>조회된 데이터가 없습니다</td>
+                  </tr>
+                  : null}
+              </tbody>
+            </table>
+            <Pagination
+              currentPage={equipmentSearch.currentPage}
+              perPage={equipmentSearch.perPage}
+              totalCount={equipment.equipmentListCount}
+              maxRange={5}
+              click={equipmentSelectList}
+            />
+          </div>
+        </div>
+      </Modal>
+
+      <div className="content-wrap row">
+        <ContentTitle contentTitle={"문의글 작성"} className={"margin-bottom2"} />
+        <SubTitle explanation={"문의 정보"} className={"margin-bottom2"} />
+        <table className="margin-bottom2 qna-insert senior-detail">
+          <tr>
+            <th><span style={{ color: "red" }}>*</span>구분</th>
+            <td colSpan={3}>
+              <div className="gender flex-start gap5">
+                <div className="flex-start">
+                  <input type="radio" id="normal_question" name="question_type" value="일반문의" style={{ width: '25px' }}
+                    checked={equipmentInquiry['equipment_serial_number'] == null}
+                    onChange={(e) => { equipmentInquiry['equipment_serial_number'] = null; setEquipmentInquiry({ ...equipmentInquiry }); }} />
+                  <label for="normal_question">일반문의</label>
+                </div>
+                <div className="flex-start">
+                  <input type="radio" id="equipment_question" name="question_type" value="장비문의" style={{ width: '25px' }}
+                    checked={equipmentInquiry['equipment_serial_number'] != null}
+                    onChange={(e) => { equipmentInquiry['equipment_serial_number'] = ''; setEquipmentInquiry({ ...equipmentInquiry }); }} />
+                  <label for="equipment_question" >장비문의</label>
+                </div>
+              </div>
+            </td>
+          </tr>
+          {equipmentInquiry['equipment_serial_number'] != null ?
+            <>
+              <tr>
+                <th><span style={{ color: "red" }}>*</span>시니어 선택</th>
+                <td>
+                  {
+                    CommonUtil.isEmpty(state.loginUser) == false
+                      && state.loginUser['authority'] == 'ROLE_GUARDIAN' && state['seniorList'].value.length > 1 ?
+                      <select onChange={(e) => {
+                        const index = Number(e.target.value);
+                        setSeniorSearch(state['seniorList'].value[index]['user_id']);
+                        equipmentSearch['senior_id'] = seniorSearch;
+                        console.log("equipmentSearch['senior_id'] : ", equipmentSearch['senior_id']);
+                      }}>
+                        {state['seniorList'].value.map((item, idx) => {
+                          return (
+                            <option key={idx} value={idx}>{item['user_name']}</option>
+                          )
+                        })}
+                      </select>
+                      : null
+                  }
+                </td>
+              </tr>
+              <tr>
+                <th><span style={{ color: "red" }}>*</span>장비문의 구분</th>
+                <td colSpan={3}>
+                  <select onChange={(e) => { equipmentInquiry['inquiry_type'] = e.target.value; setEquipmentInquiry({ ...equipmentInquiry }); }}>
+                    <option selected={equipmentInquiry['inquiry_type'] == '수리'}>수리</option>
+                    <option selected={equipmentInquiry['inquiry_type'] == '교환'}>교환</option>
+                    <option selected={equipmentInquiry['inquiry_type'] == '추가'}>추가</option>
+                    <option selected={equipmentInquiry['inquiry_type'] == '기타'}>기타</option>
+                  </select>
+                </td>
+              </tr>
+            </>
+            : null}
+          <tr>
+            <th><span style={{ color: "red" }}>*</span>문의제목</th>
+            <td colSpan={3}>
+              <input type="text" placeholder="문의글의 제목을 입력해주세요."
+                onChange={(e) => { equipmentInquiry['inquiry_title'] = e.target.value; setEquipmentInquiry({ ...equipmentInquiry }); }}
+                ref={el => equipmentInquiryRef.current['inquiry_title'] = el}
+              />
+            </td>
+          </tr>
+          <tr>
+            <th><span style={{ color: "red" }}>*</span>내용</th>
+            <td colSpan={3}>
+              <textarea className="medicine" cols="30" rows="2"
+                onChange={(e) => { equipmentInquiry['inquiry_content'] = e.target.value; setEquipmentInquiry({ ...equipmentInquiry }); }}
+                ref={el => equipmentInquiryRef.current['inquiry_content'] = el}
+              ></textarea>
+            </td>
+          </tr>
+        </table>
+
+        {equipmentInquiry['equipment_serial_number'] != null
+          ? <>
+            <SubTitle explanation={equipmentInquiry['inquiry_type'] == '교환' || equipmentInquiry['inquiry_type'] == '수리'
+              ? <span>장비 정보 <span style={{ color: "red" }}>(필수)</span></span>
+              : <span>장비 정보 (선택)</span>
+            } className={"display-inline-block margin-bottom2"} />
+            <button className={"btn-small gray-btn"} style={{ maxWidth: '150px' }} onClick={() => { equipmentSelectList(1); modalEquipmentOpen(); }}>검색</button>
+            {CommonUtil.isEmpty(equipmentInquiry.equipment['equipment_serial_number']) == false ?
+              <>
+                <button className={"btn-small red-btn"} style={{ maxWidth: '150px' }} onClick={equipmentInquirySelectCancel}>취소</button>
+                <table className="margin-bottom2 qna-insert senior-detail">
+                  <tr>
+                    <th>장비 시리얼넘버</th>
+                    <td colSpan={3}>
+                      {equipmentInquiry.equipment['equipment_serial_number']}
+                    </td>
+                  </tr>
+                  <tr>
+                    <th>모델명</th>
+                    <td>
+                      {equipmentInquiry.equipment['equipment_name']}
+                    </td>
+                    <th>장비상태</th>
+                    <td>
+                      {equipmentStates[equipmentInquiry.equipment['equipment_state']]}
+                    </td>
+                  </tr>
+                  <tr>
+                    <th>소속기관</th>
+                    <td>
+                      {equipmentInquiry.equipment['agency_id'] == null ? equipmentInquiry.equipment['government_name'] : equipmentInquiry.equipment['agency_name']}
+                    </td>
+                    <th>대여시행자</th>
+                    <td>
+                      {CommonUtil.isEmpty(equipmentInquiry.equipment['equipment_serial_number']) == false
+                        && CommonUtil.isEmpty(equipmentInquiry.equipment['rental_detail_insert_user_id']) == false
+                        ? <>
+                          {equipmentInquiry.equipment['rental_detail_insert_user_name']}
+                          ({equipmentInquiry.equipment['rental_detail_insert_user_id']})
+                        </>
+                        : '미대여'}
+                    </td>
+                  </tr>
+                  <tr>
+                    <th>장비사용대상자</th>
+                    <td>
+                      {equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_name']}
+                    </td>
+                    <th>대상자 ID</th>
+                    <td>
+                      {equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_id']}
+                    </td>
+                  </tr>
+                  <tr>
+                    <th>대상자 주소</th>
+                    <td colSpan={3}>
+                      {equipmentInquiry.equipment['user_id'] == null ? '미대여' : equipmentInquiry.equipment['user_address']}
+                    </td>
+                  </tr>
+                </table>
+              </> : null}
+          </> : null}
+
+        <div className="btn-wrap flex-center margin-top5">
+          <button className="btn-large gray-btn" onClick={() => navigate(-1)}>취소</button>
+          <button className="btn-large red-btn" onClick={() => equipmentInquiryInsert()}>등록</button>
+        </div>
+
+      </div>
+    </main>
   );
 }
client/views/pages/healthcare/HealthcareAdmin.jsx
--- client/views/pages/healthcare/HealthcareAdmin.jsx
+++ client/views/pages/healthcare/HealthcareAdmin.jsx
@@ -171,9 +171,9 @@
           chartData['time'] = data[i]['temperature_time'];
 
           if (data[i]['temperature_date'].substr(5, 2) >= 11 || data[i]['temperature_date'].substr(5, 2) <= 2) {
-            _stackTemperatureData.unshift(chartData);
-          } else {
             _stackTemperatureData.push(chartData);
+          } else {
+            _stackTemperatureData.unshift(chartData);
           }
         }
 
@@ -305,6 +305,7 @@
                         return (
                           <td data-label="최근온도">
                             {data['temperature']}
+                            {/* <small>({data['time']})</small> */}
                           </td>
                         )
                       })
@@ -344,6 +345,9 @@
               <th>생년월일</th>
               <th>성별</th>
               <th>연락처</th>
+
+              {/* <th>최근방문일</th>
+							<th>방문목적</th> */}
             </tr>
           </thead>
           <tbody>
@@ -363,6 +367,9 @@
                   <td data-label="생년월일">{item['user_birth']}</td>
                   <td data-label="성별">{item['user_gender']}</td>
                   <td data-label="연락처">{item['user_phonenumber']}</td>
+
+                  {/* <td>2023-04-11</td>
+							<td>정기방문</td> */}
                 </tr>
               )
             })}
@@ -407,6 +414,21 @@
           <div className="right" style={{ height: "100%", }}>
             <div style={{ height: "100%" }}>
               <div className="tab-container" style={{ marginTop: "5rem" }}>
+                {/* {CommonUtil.isEmpty(state.loginUser) == false && state.loginUser['authority'] == 'ROLE_AGENCY' ?
+                                <div className="flex-end margin-bottom">
+                                    <div className="flex searchselect" style={{width: 'auto'}}>
+
+                                        <input type="radio" id="my_senior" name="senior" checked={isMySenior}
+                                            onChange={(e) => {e.target.checked ? setIsMySenior(true) : null}}/>
+                                        <label for="my_senior" style={{marginRight: '3rem'}}>나의 대상자 보기</label>
+
+                                        <input type="radio" id="all_senior" name="senior" checked={!isMySenior}
+                                            onChange={(e) => {e.target.checked ? setIsMySenior(false) : null}}/>
+                                        <label for="all_senior" style={{marginRight: '0'}}>전체 대상자 보기</label>
+
+                                    </div>
+                                </div>
+                                :null} */}
                 <ul className="tab-menu flex-end">
                   {tab.map((item, idx) => {
                     return (
client/views/pages/healthcare/HealthcareSelectOne.jsx
--- client/views/pages/healthcare/HealthcareSelectOne.jsx
+++ client/views/pages/healthcare/HealthcareSelectOne.jsx
@@ -186,19 +186,18 @@
 
     isInsert: true,
   };
-  
-  
+
+
   //방문 기록 목록 조회
-  const visitRecordSelectList = (seniorNum) => {
+  const visitRecordSelectList = () => {
     fetch("/welfare/visitRecordSelectList.json", {
       method: "POST",
       headers: {
         'Content-Type': 'application/json; charset=UTF-8'
       },
-      body: JSON.stringify(seniorNum),
+      body: JSON.stringify(senior),
     }).then((response) => response.json()).then((data) => {
       console.log("방문 기록 목록 조회 결과(건수) : ", data);
-      data.search = visitRecordList.search;
       setVisitRecordList(data['visitRecordList']);
     }).catch((error) => {
       console.log('visitRecordSelectList() /user/visitRecordSelectList.json error : ', error);
@@ -208,6 +207,7 @@
 
   /****************** 방문 기록 (시작) ******************/
   //방문 기록 정보
+  const [visitDate, setVisitDate] = React.useState(null);
   const [visitRecord, setVisitRecord] = React.useState({ ...visitRecordInit });
   const visitRecordRef = React.useRef({ ...visitRecordInit });
 
@@ -332,9 +332,14 @@
     setVisitRecord({ ...visitRecordInit });
   }
 
-  const calerndarClick = (visitRecord) => {
-    console.log("calerndarClick - visitRecord", visitRecord);
-    setVisitRecord(visitRecord);
+  const calerndarClick = (data) => {
+    console.log("calerndarClick - date, visitRecord", data);
+    setVisitDate(data.date);
+    if (CommonUtil.isEmpty(data.visitData) == false) {
+      setVisitRecord(data.visitData);
+    } else {
+      setVisitRecord(null);
+    }
     openModal();
   }
 
@@ -353,76 +358,108 @@
         </div>
 
         <div className="btn-wrap flex-end margin-bottom">
-          <button className="btn-small gray-btn" onClick={() => {setVisitRecordInit(); openModal();}}>방문등록</button>
+          <button className="btn-small gray-btn" onClick={() => { setVisitRecordInit(); openModal(); }}>방문등록</button>
         </div>
 
-        <Calendar data={{ senior: senior, medication: stackChartData, temperature: stackTemperatureData, visitRecordList: visitRecordList, onClick: calerndarClick}} />
+        <Calendar data={{ senior: senior, medication: stackChartData, temperature: stackTemperatureData, visitRecordList: visitRecordList, onClick: calerndarClick }} />
 
         <div className="btn-wrap flex-center">
           <button className="btn-large gray-btn" onClick={() => { navigate(-1) }}>이전</button>
         </div>
 
-
-        <Modal open={modalOpen} close={closeModal} header="방문 정보 관리">
-          <div className="board-wrap">
-            <table className="flex70 margin-bottom">{/* questionnaire-table */}
+        <Modal open={modalOpen} close={closeModal} header="시니어 정보 관리">
+          <div className="modal-visit board-wrap">
+            <table className="margin-bottom">
               <tbody>
                 <tr>
-                  <th>방문날짜</th>
-                  <td colSpan={3}>
-                    <input type="date" value={visitRecord['visit_date']}
-                      onChange={(e) => {
-                        visitRecord['visit_date'] = e.target.value;
-                        setVisitRecord({ ...visitRecord });
-                      }}
-                      ref={el => visitRecordRef.current['visit_date'] = el}
-                    />
-                  </td>
+                  <th></th>
+                  <th>02:00</th>
+                  <th>10:00</th>
+                  <th>12:00</th>
+                  <th>23:00</th>
                 </tr>
                 <tr>
-                  <th>방문목적</th>
-                  <td>
-                    <select onChange={(e) => {
-                      visitRecord['visit_reason'] = e.target.value;
-                      setVisitRecord({ ...visitRecord });
-                    }}
-                      ref={el => visitRecordRef.current['visit_reason'] = el}
-                    >
-                      <option value="" selected={CommonUtil.isEmpty(visitRecord['visit_reason'])}>방문목적선택</option>
-                      <option value="정기방문" selected={visitRecord['visit_reason'] == "정기방문"}>정기방문</option>
-                      <option value="어르신케어" selected={visitRecord['visit_reason'] == "어르신케어"}>어르신케어</option>
-                      <option value="장비점검" selected={visitRecord['visit_reason'] == "장비점검"}>장비점검</option>
-                      <option value="정기방문" selected={visitRecord['visit_reason'] == "기타"}>기타</option>
-                    </select>
-                  </td>
+                  <th>복약량</th>
+                  <td>1</td>
+                  <td>1</td>
+                  <td>1</td>
+                  <td>1</td>
                 </tr>
                 <tr>
-                  <th>방문 상세 사유</th>
-                  <td colSpan={3}>
-                    <textarea className="medicine" style={{ height: "225px" }} name="" id="" cols="30" rows="10"
-                      value={visitRecord['visit_content']}
-                      onChange={(e) => {
-                        visitRecord['visit_content'] = e.target.value;
-                        setVisitRecord({ ...visitRecord });
-                      }}
-                      ref={el => visitRecordRef.current['visit_content'] = el}
-                    ></textarea>
-                  </td>
+                  <th>온도</th>
+                  <td>30</td>
+                  <td>29</td>
+                  <td>28</td>
+                  <td>27</td>
+                </tr>
+                <tr>
+                  <th>배터리</th>
+                  <td colSpan={4}>30%</td>
                 </tr>
               </tbody>
             </table>
-            <div className="flex-center">
-              {CommonUtil.isEmpty(visitRecord.isInsert) == false && visitRecord.isInsert
-                ? <button className="btn-small red-btn" onClick={visitRecordInsert}>등록</button>
-                : <>
-                  <button className="btn-small red-btn" onClick={visitRecordUpdate}>수정</button>
-                  <button className="btn-small red-btn" onClick={visitRecordDelete}>삭제</button>
-                </>
-              }
-            </div>
+
+            {CommonUtil.isEmpty(visitRecord) == false ? (
+              <>
+                <table className="flex70 margin-bottom">{/* questionnaire-table */}
+                  <tbody>
+                    <tr>
+                      <th>방문날짜</th>
+                      <td colSpan={3}>
+                        <input type="date" value={visitRecord['visit_date']}
+                          onChange={(e) => {
+                            visitRecord['visit_date'] = e.target.value;
+                            setVisitRecord({ ...visitRecord });
+                          }}
+                          ref={el => visitRecordRef.current['visit_date'] = el}
+                        />
+                      </td>
+                    </tr>
+                    <tr>
+                      <th>방문목적</th>
+                      <td colSpan={3}>
+                        <select onChange={(e) => {
+                          visitRecord['visit_reason'] = e.target.value;
+                          setVisitRecord({ ...visitRecord });
+                        }}
+                          ref={el => visitRecordRef.current['visit_reason'] = el}
+                        >
+                          <option value="" selected={CommonUtil.isEmpty(visitRecord['visit_reason'])}>방문목적선택</option>
+                          <option value="정기방문" selected={visitRecord['visit_reason'] == "정기방문"}>정기방문</option>
+                          <option value="어르신케어" selected={visitRecord['visit_reason'] == "어르신케어"}>어르신케어</option>
+                          <option value="장비점검" selected={visitRecord['visit_reason'] == "장비점검"}>장비점검</option>
+                          <option value="정기방문" selected={visitRecord['visit_reason'] == "기타"}>기타</option>
+                        </select>
+                      </td>
+                    </tr>
+                    <tr>
+                      <th>방문 상세 사유</th>
+                      <td colSpan={3}>
+                        <textarea className="medicine" style={{ height: "225px" }} name="" id="" cols="30" rows="10"
+                          value={visitRecord['visit_content']}
+                          onChange={(e) => {
+                            visitRecord['visit_content'] = e.target.value;
+                            setVisitRecord({ ...visitRecord });
+                          }}
+                          ref={el => visitRecordRef.current['visit_content'] = el}
+                        ></textarea>
+                      </td>
+                    </tr>
+                  </tbody>
+                </table>
+
+                <div className="flex-center">
+                  {CommonUtil.isEmpty(visitRecord.isInsert) == false && visitRecord.isInsert
+                    ? <button className="btn-small red-btn" onClick={visitRecordInsert}>등록</button>
+                    : <>
+                      <button className="btn-small red-btn" onClick={visitRecordUpdate}>수정</button>
+                      <button className="btn-small red-btn" onClick={visitRecordDelete}>삭제</button>
+                    </>}
+                </div>
+              </>
+            ) : null}
           </div>
         </Modal>
-
       </main>
     </>
   );
client/views/pages/login/Login.jsx
--- client/views/pages/login/Login.jsx
+++ client/views/pages/login/Login.jsx
@@ -3,6 +3,7 @@
 
 
 import Join from "./../join/Join.jsx";
+import passwordChange from "./../main/PasswordChange.jsx";
 import Button from "../../component/Button.jsx";
 
 
@@ -11,7 +12,7 @@
   const location = useLocation();
 
   //로그인 정보
-  const [loginInfo, setLoginInfo] = React.useState({'user_id': '', 'user_password': ''});
+  const [loginInfo, setLoginInfo] = React.useState({ 'user_id': '', 'user_password': '' });
   //사용자의 입력으로 인한 로그인 정보 변경
   const loginInfoChange = (key, value) => {
     let newLoginInfo = JSON.parse(JSON.stringify(loginInfo));
@@ -38,12 +39,8 @@
       body: JSON.stringify(loginInfo),
     }).then((response) => response.json()).then((data) => {
       console.log("로그인 결과 : ", data);
-      if (data.isSuccess == true) {
-        if(data.message == "비밀번호를 변경해주세요.") {
-          
-        } else {
-          navigate('/');
-        }
+      if (data.isSuccess == true) {       
+        navigate('/');
       } else {
         alert(data.message);
       }
@@ -55,7 +52,7 @@
   return (
     <div className="row login-wrap">
       <h1>시니어 스마트 케어 모니터링 플랫폼</h1>
-      {location.pathname == '/Join' ? (<Join/>) : (
+      {location.pathname == '/Join' ? (<Join />) : (
         <div className="container row flex-center join-login">
           <div className="login-form">
             <div>
@@ -65,16 +62,16 @@
                   <i className="fa-solid fa-user"></i>
                   <input type="text" placeholder="아이디를 입력하세요"
                     value={loginInfo['user_id']}
-                    onChange={(e) => {loginInfoChange('user_id', e.target.value)}}
-                    onKeyUp={(e) => {loginEnter(e.key)}}
+                    onChange={(e) => { loginInfoChange('user_id', e.target.value) }}
+                    onKeyUp={(e) => { loginEnter(e.key) }}
                   />
                 </div>
                 <div className="content">
                   <i className="fa-solid fa-lock"></i>
                   <input type="password" placeholder="비밀번호를 입력하세요"
                     value={loginInfo['user_password']}
-                    onChange={(e) => {loginInfoChange('user_password', e.target.value)}}
-                    onKeyUp={(e) => {loginEnter(e.key)}}
+                    onChange={(e) => { loginInfoChange('user_password', e.target.value) }}
+                    onKeyUp={(e) => { loginEnter(e.key) }}
                   />
                 </div>
               </div>
@@ -89,7 +86,7 @@
                 <Button
                   className={"join-btn"}
                   btnName={"회원가입"}
-                  onClick={() => {navigate('/Join')}}
+                  onClick={() => { navigate('/Join') }}
                 />
               </div>
             </div>
client/views/pages/main/Main_agency.jsx
--- client/views/pages/main/Main_agency.jsx
+++ client/views/pages/main/Main_agency.jsx
@@ -7,6 +7,7 @@
 import Chart2_agency from "../../component/chart/Chart2_agency.jsx";
 import AddCircleIcon from "@mui/icons-material/AddCircle";
 import Calendar_agency from "../../component/Calendar_agency.jsx";
+import Cart7 from "../../component/chart/Chart7.jsx";
 import tool from "../../../resources/files/images/tool.png";
 import medicinebox from "../../../resources/files/images/medicinebox.png";
 import box from "../../../resources/files/images/box.png";
@@ -82,19 +83,25 @@
           </li>
         </ul>
       </div>
-      <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"방문/전화 관리 리스트"}  /></div>
-      <div className="main-grid-agency">
-        <div className="content-box combine-left-government3 visitlist">  
-            <div className="margin-bottom2">
-              <Calendar_agency />
-            </div>   
-            <div>
+      <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"방문/전화 관리 리스트"} /></div>
+      <div className="main-grid-agency margin-bottom2">
+        <div className="content-box combine-left-government3 visitlist">
+          <div className="margin-bottom2">
+            <Calendar_agency />
+          </div>
+          <div className="margin-bottom2">
             <Table className="agency-visitlist" head={thead} contents={content} contentKey={key} />
-              </div>         
+          </div>
+        </div>
+      </div>
+      <div className="flex-start margin-bottom2"><img src={medicinebox} alt="" /><TitleSmall title={"연령대별 통계"} /></div>
+      <div className="main-grid-agency">
+        <div className="content-box combine-left-government3 visitlist margin-bottom2">
+          <Cart7 />
         </div>
       </div>
       <div>
-        
+
       </div>
     </main>
   );
client/views/pages/main/Main_agencyAdmin.jsx
--- client/views/pages/main/Main_agencyAdmin.jsx
+++ client/views/pages/main/Main_agencyAdmin.jsx
@@ -287,7 +287,7 @@
           <div className="flex">
             <Title title={`보호사별 대상자 등록 현황`} explanation={"약상자 사용자의 데이터 차트가 보여집니다."} />
           </div>
-          <Chart5_agencyadmin data={seniorEnroll} />
+          <Chart5_agencyadmin />
         </div>
       </div>
     </main>
client/views/pages/main/Main_guardian.jsx
--- client/views/pages/main/Main_guardian.jsx
+++ client/views/pages/main/Main_guardian.jsx
@@ -238,10 +238,14 @@
   //   searching();
   // }, []);
 
-  const calerndarClick = (date, visitRecord) => {
-    console.log("calerndarClick - date, visitRecord", date, visitRecord);
-    setVisitDate(date);
-    setVisitRecord(visitRecord);
+  const calerndarClick = (data) => {
+    console.log("calerndarClick - date, visitRecord", data);
+    setVisitDate(data.date);
+    if (CommonUtil.isEmpty(data.visitData) == false) {
+      setVisitRecord(data.visitData);
+    } else {
+      setVisitRecord(null);
+    }
     openModal();
   }
 
@@ -317,7 +321,8 @@
                 </tr>
               </tbody>
             </table>
-            {visitRecord != null ? (
+
+            {CommonUtil.isEmpty(visitRecord) == false ? (
               <table className="flex70 margin-bottom">{/* questionnaire-table */}
                 <tbody>
                   <tr>
 
client/views/pages/main/PasswordChange.jsx (added)
+++ client/views/pages/main/PasswordChange.jsx
@@ -0,0 +1,158 @@
+import React from "react";
+import Button from "../../component/Button.jsx";
+import { useNavigate, useLocation } from "react-router";
+import { useSelector } from "react-redux";
+
+import CommonUtil from "../../../resources/js/CommonUtil.js";
+
+export default function PasswordChange() {
+  const navigate = useNavigate();
+  const location = useLocation();
+  const state = useSelector((state) => { return state });
+
+  //아이디 중복 확인
+  const [isIdCheck, setIsIdCheck] = React.useState(false);
+
+  //등록할 사용자 정보
+  const [user, setUser] = React.useState({
+    'user_id': null,
+    'user_name': null,
+    'user_password': null,
+    'user_password_check': null,
+    'user_phonenumber': null,
+    'user_birth': null,
+    'user_gender': null,
+    'user_address': null,
+    'user_email': null,
+    //'authority': CommonUtil.isEmpty(defaultAuthority) ? state.loginUser['authority'] : defaultAuthority,
+    //'agency_id': CommonUtil.isEmpty(defaultAgencyId) ? state.loginUser['agency_id'] : defaultAgencyId,
+    //'government_id': CommonUtil.isEmpty(defaultGovernmentId) ? state.loginUser['government_id'] : defaultGovernmentId,
+  });
+  //각 데이터별로 Dom 정보 담을 Ref 생성
+  const userRefInit = JSON.parse(JSON.stringify(user));
+  userRefInit['user_gender'] = {};
+  userRefInit['user_id_check_button'] = null;
+  const userRef = React.useRef(userRefInit);
+  //등록할 사용자 정보 변경
+  const userValueChange = (targetKey, value) => {
+    let newUser = JSON.parse(JSON.stringify(user));
+    newUser[targetKey] = value;
+    setUser(newUser);
+  }
+  //사용자 등록 유효성 검사
+  const userInsertValidation = () => {
+    if (CommonUtil.isEmpty(user['user_password']) == true) {
+      userRef.current['user_password'].focus();
+      alert("비밀번호를 입력해 주세요.");
+      return false;
+    }
+    if (user['user_password'] != user['user_password_check']) {
+      userRef.current['user_password_check'].focus();
+      alert("비밀번호가 일치하지 않습니다.");
+      return false;
+    }
+
+    return true;
+  }
+
+  //사용자 등록
+  const userUpdate = () => {
+    if (userInsertValidation() == false) {
+      return;
+    }
+
+    fetch("/user/userUpdate.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      body: JSON.stringify(user),
+    }).then((response) => response.json()).then((data) => {
+      console.log("사용자 등록 결과(건수) : ", data);
+      if (data > 0) {
+        alert("계정생성완료");
+        navigate(-1);
+      } else {
+        alert("계정생성에 실패하였습니다. 관리자에게 문의바랍니다.");
+      }
+    }).catch((error) => {
+      console.log('userUpdate() /user/userInsert.json error : ', error);
+    });
+  }
+
+  //로그아웃
+  const logout = () => {
+    fetch("/user/logout.json", {
+      method: "POST",
+      headers: {
+        'Content-Type': 'application/json; charset=UTF-8'
+      },
+      /* body: JSON.stringify({}), */
+    }).then((response) => response.json()).then((data) => {
+      console.log("로그아웃 결과 : ", data);
+      if (data == true) {
+        navigate('/');
+      } else {
+        alert('로그아웃 실패, 관리자에게 문의바랍니다.');
+      }
+    }).catch((error) => {
+      console.log('logout() /user/logout.json error : ', error);
+    });
+  };
+
+  //Mounted
+  React.useEffect(() => {
+    //authoritiesSelect();
+    //orgSelectListOfHierarchy();
+  }, []);
+
+
+  return (
+    <div className="row login-wrap">
+      <h1>시니어 스마트 케어 모니터링 플랫폼</h1>
+      <div className="container row flex-center join-login">
+        <div className="join-group">
+          <h3>최초 로그인</h3>
+          <div className="join-inner">
+            <div>
+              <div className="margin-bottom2">
+                <p className="margin-bottom">
+                  시니어 스마트 케어 모니터링 플랫폼에 최초로 로그인 하셨습니다.
+                </p>
+                <p>
+                  최초 로그인 시, 임시 비밀번호 변경 후 이용하실 수 있습니다.
+                </p>
+              </div>
+            </div>
+            <div>
+              <div className="flex-start margin-bottom2">
+                <label className="flex25" htmlFor="password"><span style={{ color: "red" }}>*</span>비밀번호</label>
+                <input type="password"
+                  value={user['user_password']}
+                  onChange={(e) => { userValueChange('user_password', e.target.value) }}
+                  ref={el => userRef.current['user_password'] = el}
+                />
+              </div>
+            </div>
+            <div>
+              <div className="flex-start margin-bottom2">
+                <label className="flex25" htmlFor="password_check"><span style={{ color: "red" }}>*</span>비밀번호 확인</label>
+                <input type="password"
+                  value={user['user_password_check']}
+                  onChange={(e) => { userValueChange('user_password_check', e.target.value) }}
+                  ref={el => userRef.current['user_password_check'] = el}
+                />
+              </div>
+            </div>
+
+            <div className="btn-wrap">
+              <button className={"gray-btn btn-large"} onClick={logout}>취소</button>
+              <button className={"red-btn btn-large"} onClick={userUpdate}>수정</button>
+            </div>
+
+          </div>
+        </div>
+      </div>
+    </div >
+  );
+}
client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
--- client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
+++ client/views/pages/user_management/AgencyAdminSeniorSelect.jsx
@@ -7,6 +7,7 @@
 import House from "../../../resources/files/icon/house.png";
 import Arrow from "../../../resources/files/icon/arrow.png";
 
+import Modal from "../../component/Modal.jsx";
 import Modal_SeniorInsert from "../../component/Modal_SeniorInsert.jsx";
 
 import CommonUtil from "../../../resources/js/CommonUtil.js";
@@ -14,6 +15,14 @@
 export default function AgencyAdminSeniorSelect() {
   const navigate = useNavigate();
   const location = useLocation();
+
+  const [modalOpen, setModalOpen] = React.useState(false);
+  const openModal = () => {
+    setModalOpen(true);
+  };
+  const closeModal = () => {
+    setModalOpen(false);
+  };
 
   //대상자(시니어) 등록 모달 오픈 여부
   const [modalSeniorInsertIsOpen, setModalSeniorInsertIsOpen] = React.useState(false);
@@ -178,6 +187,28 @@
     });
   }
 
+  const [CheckList, setCheckList] = React.useState([]);
+  const [IdList, setIdList] = React.useState([]);
+
+  React.useEffect(() => {
+    let ids = []
+    agencySenior.seniorList.map((item, i) => {
+      ids[i] = item['user_id']
+    })
+    setIdList(ids)
+  }, [agencySenior.seniorList])
+
+  const onChangeAll = (e) => {
+    setCheckList(e.target.checked ? IdList : [])
+  }
+
+  const onChangeEach = (e, id) => {
+    if (e.target.checked) {
+      setCheckList([...CheckList, id]);
+    } else {
+      setCheckList(CheckList.filter((checkedId) => checkedId !== id));
+    }
+  }
 
   React.useEffect(() => {
     agentSelectList();
@@ -243,12 +274,16 @@
                 )
               } />
               <div className="btn-wrap flex-end margin-bottom ">
-                {/* <button className={"btn-small gray-btn"} onClick={() => {modalEquipmentOpen()}}>등록</button> */}
+                <button className={"btn-small gray-btn"} onClick={modalSeniorInsertOpen}>신규등록</button>
+                <button className={"btn-small gray-btn"} onClick={() => { openModal() }}>보호사 배정하기</button>
               </div>
             </div>
             <table className={"protector-user"}>
               <thead>
                 <tr>
+                  <th>
+                    <input type="checkbox" name="checkAll" id="checkAll" onChange={onChangeAll} checked={CheckList.length === IdList.length} />
+                  </th>
                   <th>No</th>
                   <th>소속기관명</th>
                   <th>이름</th>
@@ -264,6 +299,9 @@
                 {agencySenior.seniorList.map((item, idx) => {
                   return (
                     <tr key={idx}>
+                      <td data-label="checkbox">
+                        <input type="checkbox" name="checkSenior" id={"check" + idx} onChange={(e) => onChangeEach(e, item['user_id'])} checked={CheckList.includes(item['user_id'])} />
+                      </td>
                       <td data-label="No">{agencySenior.seniorListCount - idx - (agencySenior.search.currentPage - 1) * agencySenior.search.perPage}</td>
                       <td data-label="소속기관명">{item['agency_name']}</td>
                       <td data-label="이름">{item['user_name']}</td>
@@ -277,10 +315,7 @@
                         }
                       </td>
                       <td data-label="보호사">
-                        {CommonUtil.isEmpty(item['agent_user_names'])
-                          ? <button className="btn-small gray-btn" onClick={() => agentSeniorInsert(item)}>내 돌봄 대상자로 추가</button>
-                          : item['agent_user_names']
-                        }
+                        {item['agent_user_names']}
                       </td>
                       <td data-label="대상자관리">
                         <button className="btn-small gray-btn" onClick={() => {
@@ -367,6 +402,45 @@
           </ul>
         </div>
       </div>
+      <Modal open={modalOpen} close={closeModal} header="보호사 배정하기">
+        <div className="modal-visit board-wrap">
+          <table className="margin-bottom">
+            <tbody>
+              <tr>
+                <th>담당 보호사</th>
+                <td>
+                  <select name="" id="">
+                    <option value="">담당 보호사를 선택해주세요.</option>
+                    {agent.userList.map((user, idx) => {
+                      return (
+                        <option key={idx} value={user['user_id']}>{user['user_name']}</option>
+                      )
+                    })}
+                  </select>
+                </td>
+              </tr>
+            </tbody>
+          </table>
+          <div className="flex-center">
+            <button className="btn-small gray-btn">등록</button>
+            <button className="btn-small red-btn">삭제</button>
+          </div>
+        </div>
+      </Modal>
+
+      <Modal_SeniorInsert
+        open={modalSeniorInsertIsOpen}
+        close={modalSeniorInsertClose}
+        seniorInsertCallback={() => {
+          search.searchText = '';
+          search.searchType = '';
+          searching();
+          modalSeniorInsertClose();
+        }}
+        defaultAgentId={state.loginUser['user_id']}
+        defaultAgencyId={state.loginUser['agency_id']}
+        defaultGovernmentId={state.loginUser['government_id']}
+      />
     </main>
   );
 }
Add a comment
List