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">
{user.id &&
{user.id || true &&
<div className="left_col btn1">
<Link to={{pathname: URL.ADMIN_SCHEDULE_MODIFY}}
<Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY}}
state={{
schdulId: location.state?.schdulId
}}

View File

@ -147,20 +147,42 @@ function SchedulesEdit(props) {
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),
});
}
);
}
);
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 updateSchedule = () => {
@ -243,6 +265,11 @@ function SchedulesEdit(props) {
// 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}`,
@ -253,7 +280,7 @@ function SchedulesEdit(props) {
);
}
);
console.log("------------------------------EgovAdminScheduleEdit [%o]", scheduleDetail);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [scheduleDetail && scheduleDetail.upCommittee]);