From 3040c9c5ac69356865be3328a5a1e2d566f1628a Mon Sep 17 00:00:00 2001 From: thkim Date: Thu, 28 Dec 2023 13:30:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EC=BB=A8=ED=85=90=EC=B8=A0=20=EA=B4=80=EB=A6=AC=20=EC=AA=BD=20?= =?UTF-8?q?=EC=82=AC=EC=9D=B4=EB=93=9C=20=EB=A9=94=EB=89=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/admin/contents/PopUp.jsx | 65 ++++++++++++++++++- .../admin/contents/StandardsResearch.jsx | 43 +++++++++++- .../src/pages/admin/contents/Survey.jsx | 41 +++++++++++- .../src/pages/admin/contents/TextMessages.jsx | 41 +++++++++++- 4 files changed, 185 insertions(+), 5 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/PopUp.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/PopUp.jsx index 657a3c2..648f037 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/contents/PopUp.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/PopUp.jsx @@ -1,13 +1,76 @@ import React from 'react'; +import { Link } from 'react-router-dom'; +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function PopUp(props) { + + + + const Location = React.memo(function Location() { + return ( +
+ +
+ ) + }); return (
- PopUp +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} + +
+

컨텐츠 관리

+
+ +

팝업 관리

+ + +
+ +
+ + + + + + + + + + +
제목기간사용여부삭제
+
+
+ {/* */} +
+
+
); } + export default PopUp; \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/StandardsResearch.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/StandardsResearch.jsx index 4992f4f..11797ee 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/contents/StandardsResearch.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/StandardsResearch.jsx @@ -1,13 +1,52 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function StandardsResearch(props) { + const Location = React.memo(function Location() { + return ( +
+ +
+ ) + }); + return (
- StandardsResearch +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

컨텐츠 관리

+
+ +

건설기준연구 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } -export default StandardsResearch; \ No newline at end of file +export default StandardsResearch; diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx index cdf7669..6994d4a 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/Survey.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function Survey(props) { + const Location = React.memo(function Location() { + return ( +
+ +
+ ) + }); + return (
- Survey +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

컨텐츠 관리

+
+ +

설문 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/contents/TextMessages.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/contents/TextMessages.jsx index 08e537a..69ef21e 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/contents/TextMessages.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/contents/TextMessages.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function TextMessages(props) { + const Location = React.memo(function Location() { + return ( +
+ +
+ ) + }); + return (
- TextMessages +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

컨텐츠 관리

+
+ +

문자 발송

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } From e65a4757a894736cdb35b30600df64882852e365 Mon Sep 17 00:00:00 2001 From: thkim Date: Thu, 28 Dec 2023 13:47:35 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EA=B1=B4=EC=84=A4=20=EA=B8=B0=EC=A4=80=20=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=EC=AA=BD=20=EC=82=AC=EC=9D=B4=EB=93=9C=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/admin/committee/ProgressStatus.jsx | 41 +++++++++++++++++- .../src/pages/admin/committee/Schedules.jsx | 41 +++++++++++++++++- .../src/pages/admin/standards/ApiKeys.jsx | 41 +++++++++++++++++- .../pages/admin/standards/InfoDisclosure.jsx | 43 ++++++++++++++++++- .../pages/admin/standards/ReferenceCodes.jsx | 41 +++++++++++++++++- .../pages/admin/standards/SimilarityCheck.jsx | 41 +++++++++++++++++- 6 files changed, 241 insertions(+), 7 deletions(-) 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 c7e6ddc..a5efcf3 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 @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function ProgressStatus(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 위원회 관리
  • +
  • 진행현황 관리
  • +
+
+ ) + }); + return (
- ProgressStatus +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

위원회 관리

+
+ +

진행현황 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx index 21c41a0..cf7bf35 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function Schedules(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 위원회 관리
  • +
  • 위원회 일정 관리
  • +
+
+ ) + }); + return (
- Schedules +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

위원회 관리

+
+ +

위원회 일정 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/standards/ApiKeys.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/standards/ApiKeys.jsx index 40dcbc6..7088968 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/standards/ApiKeys.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/standards/ApiKeys.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function ApiKeys(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 건설기준 관리
  • +
  • API KEY 관리
  • +
+
+ ) + }); + return (
- ApiKeys +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

건설기준 관리

+
+ +

API KEY 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/standards/InfoDisclosure.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/standards/InfoDisclosure.jsx index 57f1e0b..0e06a5e 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/standards/InfoDisclosure.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/standards/InfoDisclosure.jsx @@ -1,13 +1,52 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function InfoDisclosure(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 건설기준 관리
  • +
  • 건설기준 내용 관리
  • +
+
+ ) + }); + return (
- InfoDisclosure +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

건설기준 관리

+
+ +

건설기준 내용 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } -export default InfoDisclosure; \ No newline at end of file +export default InfoDisclosure; diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/standards/ReferenceCodes.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/standards/ReferenceCodes.jsx index f85db00..cebd72f 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/standards/ReferenceCodes.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/standards/ReferenceCodes.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function ReferenceCodes(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 건설기준 관리
  • +
  • 참조코드 관리
  • +
+
+ ) + }); + return (
- ReferenceCodes +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

건설기준 관리

+
+ +

참조코드 관리

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/standards/SimilarityCheck.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/standards/SimilarityCheck.jsx index 9015677..7a374c5 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/standards/SimilarityCheck.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/standards/SimilarityCheck.jsx @@ -1,11 +1,50 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import URL from 'constants/url'; + +import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; function SimilarityCheck(props) { + const Location = React.memo(function Location() { + return ( +
+
    +
  • Home
  • +
  • 건설기준 관리
  • +
  • 유사성 검사
  • +
+
+ ) + }); + return (
- SimilarityCheck +
+ {/* */} + + {/* */} + +
+ {/* */} + + {/* */} + +
+ {/* */} +
+

건설기준 관리

+
+ +

유사성 검사

+ + 여기에 구현해주세요. + {/* */} +
+
+
); } From de9edc41ee9096a51e4b06512df91532884fea0d Mon Sep 17 00:00:00 2001 From: thkim Date: Thu, 28 Dec 2023 13:56:39 +0900 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=EA=B4=80=EB=A6=AC=EC=9E=90=20?= =?UTF-8?q?=EC=9C=84=EC=9B=90=ED=9A=8C=20=EA=B4=80=EB=A6=AC=20/=20?= =?UTF-8?q?=EC=9C=84=EC=9B=90=ED=9A=8C=20=EC=9D=BC=EC=A0=95=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=EC=97=90=20=EB=8B=AC=EB=A0=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/admin/committee/Schedules.jsx | 268 +++++++++++++++++- 1 file changed, 265 insertions(+), 3 deletions(-) diff --git a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx index cf7bf35..5c6235d 100644 --- a/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/admin/committee/Schedules.jsx @@ -1,13 +1,197 @@ -import React from 'react'; -import { Link } from 'react-router-dom'; +import React, { useState, useEffect, useCallback } from 'react'; +import { Link, useLocation } 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 Schedules(props) { + console.group("EgovAdminScheduleList"); + console.log("[Start] EgovAdminScheduleList ------------------------------"); + console.log("EgovAdminScheduleList [props] : ", props); + + const location = useLocation(); + console.log("EgovAdminScheduleList [location] : ", location); + + const DATE = new Date(); + const TODAY = new Date(DATE.getFullYear(), DATE.getMonth(), DATE.getDate()); + + const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { schdulSe: '', year: TODAY.getFullYear(), month: TODAY.getMonth(), date: TODAY.getDate() }); + const [calendarTag, setCalendarTag] = useState([]); + + const [scheduleList, setScheduleList] = useState([]); + + const innerConsole = (...args) => { + console.log(...args); + } + + const getLastDateOfMonth = (year, month) => { + const LAST_DATE_SUPPLMENT = 1; + return new Date(year, month + LAST_DATE_SUPPLMENT, 0); + } + const getFirstDateOfMonth = (year, month) => { + return new Date(year, month, 1); + } + + const changeDate = (target, amount) => { + let changedDate; + + if (target === CODE.DATE_YEAR) { + changedDate = new Date(searchCondition.year + amount, searchCondition.month, searchCondition.date); + } + + if (target === CODE.DATE_MONTH) { + changedDate = new Date(searchCondition.year, searchCondition.month + amount, searchCondition.date); + } + setSearchCondition({ ...searchCondition, year: changedDate.getFullYear(), month: changedDate.getMonth(), date: changedDate.getDate() }); + } + + const retrieveList = useCallback((srchcnd) => { + console.groupCollapsed("EgovAdminScheduleList.retrieveList()"); + + const retrieveListURL = '/schedule/month'+EgovNet.getQueryString(srchcnd); + + const requestOptions = { + method: "GET", + headers: { + 'Content-type': 'application/json', + } + } + + EgovNet.requestFetch(retrieveListURL, + requestOptions, + (resp) => { + setScheduleList(resp.result.resultList); + }, + function (resp) { + console.log("err response : ", resp); + } + ); + console.groupEnd("EgovAdminScheduleList.retrieveList()"); + },[]); + + const drawCalendar = () => { + console.groupCollapsed("EgovAdminScheduleList.drawCalendar()"); + const PREV_MONTH_ADDITION = -1; + + let lastOfLastMonth = getLastDateOfMonth(searchCondition.year, searchCondition.month + PREV_MONTH_ADDITION); + let firstOfThisMonth = getFirstDateOfMonth(searchCondition.year, searchCondition.month); + let lastOfThisMonth = getLastDateOfMonth(searchCondition.year, searchCondition.month); + + console.log("lastOfLastMonth : ", lastOfLastMonth, lastOfLastMonth.getDay()); + console.log("firstOfThisMonth :", firstOfThisMonth, firstOfThisMonth.getDay()); + console.log("lastOfThisMonth :", lastOfThisMonth, lastOfThisMonth.getDay()); + console.log("scheduleList : ", scheduleList); + + let firstDayOfThisMonth = firstOfThisMonth.getDay(); + let lastDateOfThisMonth = lastOfThisMonth.getDate(); + console.log("firstDayOfThisMonth", firstDayOfThisMonth, "lastDateOfThisMonth", lastDateOfThisMonth) + + let monthArr = []; + let weekArr = []; + + // firstWeek Date Set START + let firstWeekDateCount = 0; + for (let day = 0; day < 7; day++) { + if (day < firstDayOfThisMonth) { // + weekArr.push(0); + firstWeekDateCount = 0; + } else { + weekArr.push(++firstWeekDateCount); + } + } + monthArr.push(weekArr); + console.log("FirstWeek monthArr : ", monthArr); + // firstWeek Date Set END + + // otherWeek Date Set START + let dayCount = 0; + weekArr = [];//초기화 + for (let day = firstWeekDateCount + 1; day <= lastDateOfThisMonth; day++) { + + if (dayCount % 7 !== 6) { + weekArr.push(day); + } else { + weekArr.push(day); + monthArr.push(weekArr); + weekArr = []; + dayCount = -1; + } + dayCount++; + } + // otherWeek Date Set END + + // lastWeek Date Set START + if (weekArr.length > 0) {//남은 부분 + for (let day = weekArr.length; day < 7; day++) { + weekArr.push(0); + } + monthArr.push(weekArr); + } + // lastWeek Date Set END + console.log("OtherWeek monthArr : ", monthArr); + + let mutsUseYearMonth = searchCondition.year.toString() + ((searchCondition.month + 1).toString().length === 1 ? "0" + (searchCondition.month + 1).toString() : (searchCondition.month + 1).toString()); + console.log("mutsUseYearMonth : ", mutsUseYearMonth); + + let mutCalendarTagList = []; + let keyIdx = 0; + + //draw Calendar + monthArr.forEach((week, weekIdx) => { + console.log(); + mutCalendarTagList.push( + { + week.map((day, dayIdx) => { + if (day !== 0) {//당월 일별 구현 + let sDate = day.toString().length === 1 ? "0" + day.toString() : day.toString(); + let iUseDate = Number(mutsUseYearMonth + sDate); + if (scheduleList.length > 0) {//일정 있는 경우 + return ( + + {day}
+ { + scheduleList.map((schedule, scheduleIdx) => { + let iBeginDate = Number(schedule.schdulBgnde.substring(0, 8)); + let iEndDate = Number(schedule.schdulEndde.substring(0, 8)); + innerConsole("scheduleList ", day, scheduleIdx, iBeginDate, iUseDate, iEndDate, iUseDate >= iBeginDate && iUseDate <= iEndDate); + innerConsole("schedule.schdulId ", schedule.schdulId); + if (iUseDate >= iBeginDate && iUseDate <= iEndDate) { + return ( + <> + {schedule.schdulNm} + +
+ + ); + } else return <> + }) + } + + ); + } else {//일정 없는 경우 + return ( + + {day}
+ ); + } + } else if (day === 0) {// 이전달/다음달 구현 + return (); + } else return <> + }) + }); + }) + console.log("mutCalendarTagList : ", mutCalendarTagList); + setCalendarTag(mutCalendarTagList); + console.groupEnd("EgovAdminScheduleList.drawCalendar()"); + } + const Location = React.memo(function Location() { return (
@@ -20,6 +204,19 @@ function Schedules(props) { ) }); + useEffect(() => { + retrieveList(searchCondition); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [searchCondition]); + + useEffect(() => { + drawCalendar(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [scheduleList]); + + console.log("------------------------------EgovAdminScheduleList [End]"); + console.groupEnd("EgovAdminScheduleList"); + return (
@@ -39,8 +236,73 @@ function Schedules(props) {

위원회 일정 관리

+ {/* */} +
+
    +
  • + +
  • +
  • + + {searchCondition.year} + +
  • +
  • + + {(searchCondition.month + 1)} + +
  • +
+
+ {/* */} - 여기에 구현해주세요. +
+ + + + + + + + + + + + + + {calendarTag} + +
+
{/* */}