From 31e8d91c15902618632def7f90cd9d7987e63c1c Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 8 Mar 2024 09:20:10 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B4=80=EB=A6=AC=EC=9E=90=20-=20=EC=9C=84?= =?UTF-8?q?=EC=9B=90=ED=9A=8C=EA=B4=80=EB=A6=AC>=20=EC=A7=84=ED=96=89?= =?UTF-8?q?=ED=98=84=ED=99=A9=20=EA=B4=80=EB=A6=AC>=20=EC=9E=90=EC=84=B8?= =?UTF-8?q?=ED=9E=88=20=EB=B3=B4=EA=B8=B0=20=EB=8C=80=EB=9E=B5=EC=A0=81?= =?UTF-8?q?=EC=9D=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/constants/url.js | 3 + .../pages/admin/committee/ProgressStatus.jsx | 2 +- .../admin/committee/ProgressStatus/Detail.jsx | 173 +++++++ .../admin/committee/ProgressStatus/Edit.jsx | 483 ++++++++++++++++++ .../src/routes/index.jsx | 10 +- 5 files changed, 669 insertions(+), 2 deletions(-) create mode 100644 egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx create mode 100644 egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx diff --git a/egovframe-template-simple-react-contribution/src/constants/url.js b/egovframe-template-simple-react-contribution/src/constants/url.js index 561f959..22f6ce3 100644 --- a/egovframe-template-simple-react-contribution/src/constants/url.js +++ b/egovframe-template-simple-react-contribution/src/constants/url.js @@ -109,6 +109,9 @@ const URL = { // 관리자 - 위원회 관리 ADMIN__COMMITTEE__PROGRESS_STATUS : "/admin/committee/progress-status", // 위원회 관리/진행현황 관리 + ADMIN__COMMITTEE__PROGRESS_STATUS__DETAIL : "/admin/committee/progress-status/detail", // 위원회 관리/진행현황 관리/진행현황 관리 상세 + ADMIN__COMMITTEE__PROGRESS_STATUS__CREATE : "/admin/committee/progress-status/create", // 위원회 관리/진행현황 관리/진행현황 관리 생성 + ADMIN__COMMITTEE__PROGRESS_STATUS__MODIFY : "/admin/committee/progress-status/modify", // 위원회 관리/진행현황 관리/진행현황 관리 수정 ADMIN__COMMITTEE__SCHEDULES : "/admin/committee/schedules", // 위원회 관리/위원회 일정 관리 ADMIN__COMMITTEE__SCHEDULES__DETAIL : "/admin/committee/schedules/detail", // 위원회 관리/위원회 일정 관리/일정관리상세 ADMIN__COMMITTEE__SCHEDULES__CREATE : "/admin/committee/schedules/create", // 위원회 관리/위원회 일정 관리/일정관리생성 diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx index 94ff4e8..840a9b3 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus.jsx @@ -190,7 +190,7 @@ function ProgressStatus(props) {
{it.number}
{it.drftTypeNm}
-
{it.categoryNm}
{it.title}
+
{it.categoryNm}
{it.title}
{it.orgNm}
진행단계표시
{it.regDate}
diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx new file mode 100644 index 0000000..79f2bf4 --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Detail.jsx @@ -0,0 +1,173 @@ +import React, { useState, useEffect } from 'react'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; + +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; +import CODE from 'constants/code'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; + +function SchedulesDetail(props) { + console.group("EgovAdmindetailItem"); + console.log("EgovAdmindetailItem [props] : ", props); + + const navigate = useNavigate(); + const location = useLocation(); + + const [detailItem, setDetailItem] = useState({}); + + const retrieveDetail = () => { + + const retrieveDetailURL = `/admin/committee/progress-status/${location.state?.drftSeq}`; + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json', + } + } + EgovNet.requestFetch(retrieveDetailURL, + requestOptions, + function (resp) { + setDetailItem(resp.result.item); + } + ); + } + + const onClickDeleteSchedule = (drftSeq) => { + const deleteBoardURL = `/admin/committee/progress-status/${drftSeq}`; + + const requestOptions = { + method: "DELETE", + headers: { + 'Content-type': 'application/json', + } + } + + EgovNet.requestFetch(deleteBoardURL, + requestOptions, + (resp) => { + console.log("====>>> Schdule delete= ", resp); + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert("게시글이 삭제되었습니다.") + navigate(URL.ADMIN__COMMITTEE__SCHEDULES ,{ replace: true }); + } else { + // alert("ERR : " + resp.message); + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + + } + ); + } + + useEffect(function () { + retrieveDetail(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + console.groupEnd("EgovAdmindetailItem"); + return ( +
+
+ {/* */} +
+
    +
  • Home
  • +
  • 사이트관리
  • +
  • 위원회관리
  • +
  • 진행현황 관리
  • +
+
+ {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

진행현황 관리

+
+ + {/* */} +
+
+
안건
+
{detailItem.title}
+
+
+
기준코드
+
{detailItem.standardCode}
+
+
+
구분
+
{detailItem.drftTypeNm}
+
+
+
회의일자
+
{detailItem.regDate}
+
+
+
위원회
+
{detailItem.orgNm}
+
+
+
회의담당자
+
{detailItem.drftConfeCharger}
+
+
+
회의실 비밀번호
+
{detailItem.drftConfePw}
+
+
+
사전검토자료
+
{detailItem.seq}
+
+
+
사전검토양식
+
{detailItem.seq}
+
+
+
관계기관의견
+
{detailItem.seq}
+
+
+
조치계획서
+
{detailItem.seq}
+
+
+
조치결과서
+
{detailItem.seq}
+
+
+
회의 안건
+
{detailItem.drftSummery}
+
+
+
회의 내용
+
{detailItem.seq}
+
+ + {/* */} +
+
+ 목록 +
+
+ {/* */} + + +
+ {/* */} + + {/* */} +
+
+
+
+ ); +} + +export default SchedulesDetail; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx new file mode 100644 index 0000000..b5b570b --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/ProgressStatus/Edit.jsx @@ -0,0 +1,483 @@ +import React, { useState, useEffect } from 'react'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; +import DatePicker from "react-datepicker"; + + + +import * as EgovNet from 'api/egovFetch'; +import URL from 'constants/url'; +import CODE from 'constants/code'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; + +import 'react-datepicker/dist/react-datepicker.css'; + +import styled from "styled-components"; +import { makeStyles } from "@mui/styles"; + +const useStyles = makeStyles(() => ({ + shake: { + animation: "$description 15s", + animationIterationCount: "1" + }, + "@keyframes description": { + "0%": { opacity: 0, transform: "translateY(0)" }, + "15%": { transform: "translateY(-4px, 0)" }, + "30%": { transform: "translateY(6px, 0)" }, + "45%": { transform: "translateY(-4px, 0)" }, + "60%": { transform: "translateY(6px, 0)" }, + "100%": { opacity: 1, transform: "translateY(0)" } + } + })); + +const StyledDiv = styled.div` + .org-under-id { + margin-left: 20px; + @media only screen and (max-width: 768px) { + display: block; + margin-left: 0px; + margin-top: 20px; + } + } + + .f_select.w_250 { + @media only screen and (max-width: 768px) { + width: 100%; + } + } + + .f_input { + @media only screen and (max-width: 768px) { + width: 100%; + } + } +`; + +function SchedulesEdit(props) { + console.group("EgovAdminScheduleEdit"); + console.log("[Start] EgovAdminScheduleEdit ------------------------------"); + console.log("EgovAdminScheduleEdit [props] : ", props); + + const classes = useStyles(); + const [isShake, setShake] = useState(false); + + //${location.state?.schdulId + + const getDateFourteenDigit = (date) => { + return `${getYYYYMMDD(date).toString()}${makeTwoDigit(date.getHours())}${makeTwoDigit(date.getMinutes())}${makeTwoDigit(date.getSeconds())}`; + } + const getYYYYMMDD = (date) => { + return date.getFullYear().toString() + makeTwoDigit(Number(date.getMonth() + 1)) + makeTwoDigit(date.getDate()); + } + const makeTwoDigit = (number) => { + return number < 10 ? "0" + number : number.toString(); + } + + + const navigate = useNavigate(); + const location = useLocation(); + console.log("EgovAdminScheduleEdit [location] : ", location); + + const [modeInfo, setModeInfo] = useState({ mode: props.mode }); + const [scheduleDetail, setScheduleDetail] = useState + ( + { + startDate: new Date(), + endDate: new Date(), + eventId : 0, + } + ); + + const [schdulBgndeHH, setSchdulBgndeHH] = useState(); + const [schdulBgndeMM, setSchdulBgndeMM] = useState(); + const [schdulEnddeHH, setSchdulEnddeHH] = useState(); + const [schdulEnddeMM, setSchdulEnddeMM] = useState(); + + const [scheduleInit, setScheduleInit] = useState({}); + const [scheduleApiOrgApiDepthList, setScheduleApiOrgApiDepthList] = useState({ }); + + + const initMode = () => { + + // props.mode 값이 없으면 에러가 발생한다. + switch (props.mode) { + case CODE.MODE_CREATE: + setModeInfo({ + ...modeInfo, + modeTitle: "등록", + method : "POST", + editURL: '/schedule' + }); + break; + case CODE.MODE_MODIFY: + setModeInfo({ + ...modeInfo, + modeTitle: "수정", + method : "PUT", + editURL: '/schedule' + }); + break; + default: + navigate({pathname: URL.ERROR}, {state: {msg : ""}}); + } + retrieveDetail(); + } + + const convertDate = (str) => { + let year = str.substring(0, 4); + let month = str.substring(4, 6); + let date = str.substring(6, 8); + let hour = str.substring(8, 10); + let minute = str.substring(10, 12); + return new Date(year, month - 1, date, hour, minute) + } + + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json' + } + } + + const retrieveDetail = () => { + + EgovNet.requestFetch("/schedule/init", + requestOptions, + function (resp) { + setScheduleInit( + resp + ); + + if (modeInfo.mode === CODE.MODE_CREATE) {// 조회/등록이면 조회 안함 + setScheduleDetail({ + ...scheduleDetail, + schdulBgnde: location.state.iUseDate, + schdulEndde: location.state.iUseDate, + startDate: convertDate(location.state.iUseDate), + endDate: convertDate(location.state.iUseDate), + }); + return; + } + + const retrieveDetailURL = `/schedule/${location.state?.schdulId}`; + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json' + } + } + EgovNet.requestFetch(retrieveDetailURL, + requestOptions, + function (resp) { + + let rawScheduleDetail = resp.result; + //기본값 설정 + setScheduleDetail({ + ...scheduleDetail, + ...rawScheduleDetail, + startDate: convertDate(rawScheduleDetail.schdulBgnde), + endDate: convertDate(rawScheduleDetail.schdulEndde), + }); + } + ); + } + ); + + } + + const updateSchedule = () => { + const formData = new FormData(); + + for (let key in scheduleDetail) { + if ( key === 'startDate' ) { + formData.append(key, getDateFourteenDigit( scheduleDetail[key] )); + } else if( key === 'endDate' ) { + formData.append(key, getDateFourteenDigit( scheduleDetail[key] )); + } else { + formData.append(key, scheduleDetail[key]); + } + + console.log("scheduleDetail [%s] ", key, scheduleDetail[key]); + } + + if ( formValidator(formData) ) { + const requestOptions = { + method: modeInfo.method, + body: formData + } + + if (modeInfo.mode === CODE.MODE_MODIFY) { + modeInfo.editURL = `${modeInfo.editURL}/${location.state?.schdulId}`; + } + EgovNet.requestFetch(modeInfo.editURL, + requestOptions, + (resp) => { + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert('일정이 등록되었습니다.'); + navigate({ pathname: URL.ADMIN__COMMITTEE__SCHEDULES__DETAIL }, {state: {schdulId : resp.result?.schdulId}}); + } else { + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + } + ); + } + + } + + const formValidator = (formData) => { + + if (formData.get('divMeet') === null || formData.get('divMeet') === "") { + alert("구분을 선택해 주세요."); + return false; + } + if (formData.get('upCommittee') === null || formData.get('upCommittee') === "") { + alert("심의위원회 첫 번째 값을 선택해 주세요."); + return false; + } + if (formData.get('committee') === null || formData.get('committee') === "") { + alert("심의위원회 두 번째 값을 선택해 주세요."); + return false; + } + if (formData.get('title') === null || formData.get('title') === "") { + alert("제목을 입력해 주세요."); + return false; + } + if (formData.get('location') === null ||formData.get('location') === "") { + alert("장소를 입력해 주세요."); + return false; + } + if (formData.get('contents') === null ||formData.get('contents') === "") { + alert("내용을 입력해 주세요."); + return false; + } + if (formData.get('schdulBgnde') > formData.get('schdulEndde')) { + alert("종료일시는 시작일시보다 앞 설 수 없습니다."); + //return false; + } + return true; + } + + useEffect(function () { + initMode(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + useEffect(function () { + console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scheduleDetail]); + + useEffect(function () { + + EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`, + requestOptions, + function (resp) { + setScheduleApiOrgApiDepthList( + resp + ); + } + ); + console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scheduleDetail && scheduleDetail.upCommittee]); + + + const onClickDeleteSchedule = (schdulId) => { + const deleteBoardURL = `/schedule/${schdulId}`; + + const requestOptions = { + method: "DELETE", + headers: { + 'Content-type': 'application/json', + } + } + + EgovNet.requestFetch(deleteBoardURL, + requestOptions, + (resp) => { + console.log("====>>> Schdule delete= ", resp); + if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) { + alert("게시글이 삭제되었습니다.") + navigate(URL.ADMIN__COMMITTEE__SCHEDULES ,{ replace: true }); + } else { + navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}}); + } + + } + ); + } + + console.log("------------------------------EgovAdminScheduleEdit [End]"); + console.groupEnd("EgovAdminScheduleEdit"); + return ( +
+
+ {/* */} +
+
    +
  • Home
  • +
  • 사이트 관리
  • +
  • 위원회 관리
  • +
  • 위원회 일정 관리
  • +
+
+ {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

위원회 일정 관리

+
+ + {/* */} + + {/* */} + +
+
구분필수
+
+ +
+
+
+
심의위원회필수
+
+ + +
+
+
+
필수
+
+ setScheduleDetail({ ...scheduleDetail, title: e.target.value })} + /> +
+
+
+
필수
+
+ setScheduleDetail({ ...scheduleDetail, location: e.target.value })} /> +
+
+
+
날짜/시간필수
+
+ + { + console.log("setStartDate : ", date); + setScheduleDetail({ ...scheduleDetail, schdulBgnde: getDateFourteenDigit(date), schdulBgndeYYYMMDD: getYYYYMMDD(date), schdulBgndeHH: date.getHours(), schdulBgndeMM: date.getMinutes(), startDate: date }); + setSchdulBgndeHH(date.getHours()); + setSchdulBgndeMM(date.getMinutes()); + }} /> + + + ~ + + + { + console.log("setEndDate: ", date); + setScheduleDetail({ ...scheduleDetail, schdulEndde: getDateFourteenDigit(date), schdulEnddeYYYMMDD: getYYYYMMDD(date), schdulEnddeHH: date.getHours(), schdulEnddeMM: date.getMinutes(), endDate: date }); + setSchdulEnddeHH(date.getHours()); + setSchdulEnddeMM(date.getMinutes()); + } + } /> + + + +
+
+
+
필수
+
+ +
+
+ + {/* */} +
+
+ + {modeInfo.mode === CODE.MODE_MODIFY && + + } + +
+ +
+ 목록 +
+
+ {/* */} +
+ {/* */} + + {/* */} +
+
+
+
+ ); +} + +export default SchedulesEdit; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/routes/index.jsx b/egovframe-template-simple-react-contribution/src/routes/index.jsx index d3dc967..10e53ce 100644 --- a/egovframe-template-simple-react-contribution/src/routes/index.jsx +++ b/egovframe-template-simple-react-contribution/src/routes/index.jsx @@ -97,7 +97,11 @@ import AdminContentsStandardResearchEditor from 'pages/admin/contents/StandardRe // import AdminContentsTextMessages from 'pages/admin/contents/TextMessages'; // 관리자 - 컨텐츠 관리/문자 발송 // 관리자 - 위원회 관리 -import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // 관리자 - 위원회 관리/진행현황 관리 +import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // 관리자 - 위원회 관리/진행현황 관리 +import AdminCommitteeProgressStatusDetail from 'pages/admin/committee/ProgressStatus/Detail'; // 관리자 - 위원회 관리/진행현황 관리/진행현황 관리 상세 +import AdminCommitteeProgressStatusEdit from 'pages/admin/committee/ProgressStatus/Edit'; // 관리자 - 위원회 관리/진행현황 관리/진행현황 관리 생성 또는 수정 + + import AdminCommitteeSchedules from 'pages/admin/committee/Schedules'; // 관리자 - 위원회 관리/위원회 일정 관리 import AdminCommitteeSchedulesDetail from 'pages/admin/committee/Schedules/Detail'; // 관리자 - 위원회 관리/위원회 일정 관리/일정관리상세 import AdminCommitteeSchedulesEdit from 'pages/admin/committee/Schedules/Edit'; // 관리자 - 위원회 관리/위원회 일정 관리/일정관리생성 또는 수정 @@ -313,6 +317,10 @@ const SecondRoutes = () => { {/* 관리자 - 위원회 관리 */} } /> + } /> + } /> + } /> + } /> } /> } />