import React from "react"; import Table from "../../component/Table.jsx"; import Button from "../../component/Button.jsx"; import SubTitle from "../../component/SubTitle.jsx"; import Modal from "../../component/Modal.jsx"; import Category from "../../component/Category.jsx"; import { useNavigate } from "react-router"; export default function EquipmentManagementSelect() { const [modalOpen, setModalOpen] = React.useState(false); const openModal = () => { setModalOpen(true); }; const closeModal = () => { setModalOpen(false); }; const [modalOpen3, setModalOpen3] = React.useState(false); const openModal3 = () => { // equipmentListData(); setModalOpen3(true); }; const closeModal3 = () => { setModalOpen3(false); }; // 대상자 매칭 반납 const seniorMatchDelete = () => { if (confirm('아니다') == false) { return; } // 대상자 매칭 삭제 함수 사용하기 }; const navigate = useNavigate(); /********************************** 관리자 장비 (시작) **********************************/ // 관리자 전체 장비 목록 const [equipmentList, setEquipmentList] = React.useState([]); // 관리자 전체 장비 목록 조회 const equipmentSelectList = () => { console.log('equipmentSelectList Function Run'); fetch("/equipment/equipmentSelectList.json", { method: "POST", headers: { 'Content-Type': 'application/json; charset=UTF-8' }, body: JSON.stringify({}) }).then((response) => response.json()).then((data) => { console.log('equipmentSelectList response : ', data); setEquipmentList(data); }).catch((error) => { console.log('equipmentSelectList error : ', error); }); } const thead1 = [ "No", "모델 명", "시리얼 넘버", "입고 일자", "상태", "보유 기관", "대상자", "관리", ]; const key1 = [ "equipment_name", "equipment_serial_number", "equipment_stock_date", "equipment_state", "agency_name", "senior_name", ]; const thead2 = [ "No", "장비명", "시리얼 넘버", "입고일자", "납품 기관",//관리기관, 올잇메디 "대상자",//시행기관 ]; const key2 = [ "No", "equipment", "serialNumber", "date", "agency", "senior", ]; const content2 = [ { No: 1, equipment: "스마트약상자", serialNumber: "ABCD-1", date: "2022.12.02", agency: (