feat: 관리자 - 위원회관리 - 위원회 일정관리에서 일정 수정 시 저장 기능 구현 건

thkim
thkim 2024-01-22 17:32:10 +09:00
parent 5677e0dfe9
commit 2944f9d95e
2 changed files with 41 additions and 14 deletions

View File

@ -139,9 +139,9 @@ function SchedulesDetail(props) {
{/* <!-- 버튼영역 --> */} {/* <!-- 버튼영역 --> */}
<div className="board_btn_area"> <div className="board_btn_area">
{user.id && {user.id || true &&
<div className="left_col btn1"> <div className="left_col btn1">
<Link to={{pathname: URL.ADMIN_SCHEDULE_MODIFY}} <Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY}}
state={{ state={{
schdulId: location.state?.schdulId schdulId: location.state?.schdulId
}} }}

View File

@ -147,19 +147,41 @@ function SchedulesEdit(props) {
setScheduleInit( setScheduleInit(
resp 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),
});
}
);
} }
); );
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;
}
} }
@ -243,6 +265,11 @@ function SchedulesEdit(props) {
// eslint-disable-next-line react-hooks/exhaustive-deps // 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 () { useEffect(function () {
EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`, EgovNet.requestFetch(`/schedule/api/org-api/depth/list?paramCodeGroup=${scheduleDetail.upCommittee}`,
@ -253,7 +280,7 @@ function SchedulesEdit(props) {
); );
} }
); );
console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail);
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [scheduleDetail && scheduleDetail.upCommittee]); }, [scheduleDetail && scheduleDetail.upCommittee]);