강석 최 2024-01-03 17:59:17 +09:00
commit 6713bc933d
22 changed files with 1461 additions and 17599 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
**/.idea
**/.vscode

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/kcscDev.iml" filepath="$PROJECT_DIR$/.idea/kcscDev.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="cbd5a5a9-c605-4176-9f67-f130dc5cafd5" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/egovframe-template-simple-react-contribution/yarn.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kcsc-back-end/src/main/resources/application.properties" beforeDir="false" afterPath="$PROJECT_DIR$/kcsc-back-end/src/main/resources/application.properties" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 3
}]]></component>
<component name="ProjectId" id="2ZsMR0eqQ4kriuFhAPE5h7h5XZA" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "thkim",
"last_opened_file_path": "C:/Users/dbnt/git/dbnt/kcscDev"
}
}]]></component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="cbd5a5a9-c605-4176-9f67-f130dc5cafd5" name="Changes" comment="" />
<created>1703206321951</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1703206321951</updated>
</task>
<servers />
</component>
</project>

View File

@ -1,15 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
"react-loader-spinner": "^5.4.5", "react-loader-spinner": "^5.4.5",
"react-router-dom": "^6.4.0", "react-router-dom": "^6.4.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"recharts": "^2.10.3",
"styled-components": "^6.0.9", "styled-components": "^6.0.9",
"web-vitals": "^2.1.4" "web-vitals": "^2.1.4"
}, },

View File

@ -62,7 +62,7 @@ function EgovLeftNavAdmin({activeKey}) {
<ul className="menu4"> <ul className="menu4">
<li><NavLink to={URL.ADMIN__CONTENTS__SURVEY} className={({ isActive }) => (isActive ? "cur" : "")}>설문 관리</NavLink></li> <li><NavLink to={URL.ADMIN__CONTENTS__SURVEY} className={({ isActive }) => (isActive ? "cur" : "")}>설문 관리</NavLink></li>
<li><NavLink to={URL.ADMIN__CONTENTS__POP_UP} className={({ isActive }) => (isActive ? "cur" : "")}>팝업 관리</NavLink></li> <li><NavLink to={URL.ADMIN__CONTENTS__POP_UP} className={({ isActive }) => (isActive ? "cur" : "")}>팝업 관리</NavLink></li>
<li><NavLink to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준연구 관리</NavLink></li> <li><NavLink to={URL.ADMIN__CONTENTS__STANDARD_RESEARCH} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준연구 관리</NavLink></li>
<li><NavLink to={URL.ADMIN__CONTENTS__TEXT_MESSAGES} className={({ isActive }) => (isActive ? "cur" : "")}>문자 발송</NavLink></li> <li><NavLink to={URL.ADMIN__CONTENTS__TEXT_MESSAGES} className={({ isActive }) => (isActive ? "cur" : "")}>문자 발송</NavLink></li>
</ul> </ul>
</Accordion.Body> </Accordion.Body>

View File

@ -106,6 +106,9 @@ const URL = {
// 관리자 - 위원회 관리 // 관리자 - 위원회 관리
ADMIN__COMMITTEE__PROGRESS_STATUS : "/admin/committee/progress-status", // 위원회 관리/진행현황 관리 ADMIN__COMMITTEE__PROGRESS_STATUS : "/admin/committee/progress-status", // 위원회 관리/진행현황 관리
ADMIN__COMMITTEE__SCHEDULES : "/admin/committee/schedules", // 위원회 관리/위원회 일정 관리 ADMIN__COMMITTEE__SCHEDULES : "/admin/committee/schedules", // 위원회 관리/위원회 일정 관리
ADMIN__COMMITTEE__SCHEDULES__DETAIL : "/admin/committee/schedules/detail", // 위원회 관리/위원회 일정 관리/일정관리상세
ADMIN__COMMITTEE__SCHEDULES__CREATE : "/admin/committee/schedules/create", // 위원회 관리/위원회 일정 관리/일정관리생성
ADMIN__COMMITTEE__SCHEDULES__MODIFY : "/admin/committee/schedules/modify", // 위원회 관리/위원회 일정 관리/일정관리수정
// 관리자 - 로그 관리 // 관리자 - 로그 관리
ADMIN__LOGS__MENU_ACCESS_INFO : "/admin/logs/menu-access-info", // 위원회 관리/메뉴별 접속현황 ADMIN__LOGS__MENU_ACCESS_INFO : "/admin/logs/menu-access-info", // 위원회 관리/메뉴별 접속현황

View File

@ -153,7 +153,7 @@ function Schedules(props) {
if (scheduleList.length > 0 || sDate === "01") {// if (scheduleList.length > 0 || sDate === "01") {//
return ( return (
<td key={keyIdx++}> <td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br /> <Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
{ {
<div> <div>
<div>오후 03:00 [P] 해양경찰청</div> <div>오후 03:00 [P] 해양경찰청</div>
@ -166,7 +166,7 @@ function Schedules(props) {
} else {// } else {//
return ( return (
<td key={keyIdx++}> <td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br /> <Link to={{pathname: URL.ADMIN__COMMITTEE__SCHEDULES__CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
</td>); </td>);
} }
} else if (day === 0) {// / } else if (day === 0) {// /

View File

@ -0,0 +1,202 @@
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';
import EgovAttachFile from 'components/EgovAttachFile';
function SchedulesDetail(props) {
console.group("EgovAdminScheduleDetail");
console.log("[Start] EgovAdminScheduleDetail ------------------------------");
console.log("EgovAdminScheduleDetail [props] : ", props);
const navigate = useNavigate();
const location = useLocation();
console.log("EgovAdminScheduleDetail [location] : ", location);
const [scheduleDetail, setScheduleDetail] = useState({});
const [boardAttachFiles, setBoardAttachFiles] = useState();
const [user, setUser] = useState({});
const retrieveDetail = () => {
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.scheduleDetail;
rawScheduleDetail.startDateTime = convertDate(rawScheduleDetail.schdulBgnde);
rawScheduleDetail.endDateTime = convertDate(rawScheduleDetail.schdulEndde);
rawScheduleDetail.reptitSeCodeNm = getCodeName(resp.result.reptitSeCode, resp.result.scheduleDetail.reptitSeCode);
rawScheduleDetail.schdulIpcrCodeNm = getCodeName(resp.result.schdulIpcrCode, resp.result.scheduleDetail.schdulIpcrCode);
rawScheduleDetail.schdulSeNm = getCodeName(resp.result.schdulSe, resp.result.scheduleDetail.schdulSe);
setScheduleDetail(rawScheduleDetail);
setUser(resp.result.user);
setBoardAttachFiles(resp.result.resultFiles);
}
);
}
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 {
year: year,
month: month,
date: date,
hour: hour,
minute: minute,
dateForm: year + "년 " + month + "월 " + date + "일 " + hour + "시 " + minute + "분 "
}
}
const getCodeName = (codeArr, code) => {
return (
codeArr.map((codeObj) => {
if (codeObj.code === code.trim()) return codeObj.codeNm
else return "";
})
);
};
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_SCHEDULE ,{ 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.log("------------------------------EgovAdminScheduleDetail [End]");
console.groupEnd("EgovAdminScheduleDetail");
return (
<div className="container">
<div className="c_wrap">
{/* <!-- Location --> */}
<div className="location">
<ul>
<li><Link to={URL.MAIN} className="home">Home</Link></li>
<li><Link to={URL.ADMIN}>사이트관리</Link></li>
<li>일정관리</li>
</ul>
</div>
{/* <!--// Location --> */}
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav></EgovLeftNav>
{/* <!--// Navigation --> */}
<div className="contents SITE_GALLARY_VIEW" id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">사이트관리</h1>
</div>
<h2 className="tit_2">일정관리 상세보기</h2>
{/* <!-- 게시판 상세보기 --> */}
<div className="board_view2">
<dl>
<dt>일정구분</dt>
<dd>{scheduleDetail.schdulSeNm}</dd>
</dl>
<dl>
<dt>중요도</dt>
<dd>{scheduleDetail.schdulIpcrCodeNm}</dd>
</dl>
<dl>
<dt>부서</dt>
<dd>{scheduleDetail.schdulDeptName}</dd>
</dl>
<dl>
<dt>일정명</dt>
<dd>{scheduleDetail.schdulNm}</dd>
</dl>
<dl>
<dt>일정내용</dt>
<dd>{scheduleDetail.schdulCn}</dd>
</dl>
<dl>
<dt>반복구분</dt>
<dd>{scheduleDetail.reptitSeCodeNm}</dd>
</dl>
<dl>
<dt>날짜/시간</dt>
<dd> {scheduleDetail.startDateTime?.dateForm} ~ {scheduleDetail.endDateTime?.dateForm}</dd>
</dl>
<dl>
<dt>담당자</dt>
<dd>{scheduleDetail.schdulChargerName}</dd>
</dl>
<EgovAttachFile boardFiles={boardAttachFiles} />
{/* <!-- 버튼영역 --> */}
<div className="board_btn_area">
{user.id &&
<div className="left_col btn1">
<Link to={{pathname: URL.ADMIN_SCHEDULE_MODIFY}}
state={{
schdulId: location.state?.schdulId
}}
className="btn btn_skyblue_h46 w_100">수정</Link>
<button className="btn btn_skyblue_h46 w_100"
onClick={(e) => {
onClickDeleteSchedule(location.state?.schdulId);
}}>삭제</button>
</div>
}
<div className="right_col btn1">
<Link to={URL.ADMIN_SCHEDULE} className="btn btn_blue_h46 w_100">목록</Link>
</div>
</div>
{/* <!--// 버튼영역 --> */}
</div>
{/* <!-- 게시판 상세보기 --> */}
{/* <!--// 본문 --> */}
</div>
</div>
</div>
</div>
);
}
export default SchedulesDetail;

View File

@ -0,0 +1,366 @@
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 EgovAttachFile from 'components/EgovAttachFile';
import EgovRadioButtonGroup from 'components/EgovRadioButtonGroup';
import 'react-datepicker/dist/react-datepicker.css';
function SchedulesEdit(props) {
console.group("EgovAdminScheduleEdit");
console.log("[Start] EgovAdminScheduleEdit ------------------------------");
console.log("EgovAdminScheduleEdit [props] : ", props);
const navigate = useNavigate();
const location = useLocation();
console.log("EgovAdminScheduleEdit [location] : ", location);
const reptitSeCodeRadioGroup = [{ value: "1", label: "당일" }, { value: "2", label: "반복" }, { value: "3", label: "연속" }];
const [modeInfo, setModeInfo] = useState({ mode: props.mode });
const [scheduleDetail, setScheduleDetail] = useState({ schdulDeptName: "관리자부서", schdulChargerName: "관리자", schdulKindCode: 2, reptitSeCode: "1", startDate: new Date(), endDate: new Date() });
const [boardAttachFiles, setBoardAttachFiles] = useState();
const [schdulBgndeHH, setSchdulBgndeHH] = useState();
const [schdulBgndeMM, setSchdulBgndeMM] = useState();
const [schdulEnddeHH, setSchdulEnddeHH] = useState();
const [schdulEnddeMM, setSchdulEnddeMM] = 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 retrieveDetail = () => {
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.scheduleDetail;
//
setScheduleDetail({
...scheduleDetail,
...rawScheduleDetail,
startDate: convertDate(rawScheduleDetail.schdulBgnde),
endDate: convertDate(rawScheduleDetail.schdulEndde),
atchFileId : rawScheduleDetail.atchFileId.trim(),
});
setBoardAttachFiles(resp.result.resultFiles);
}
);
}
const updateSchedule = () => {
const formData = new FormData();
for (let key in scheduleDetail) {
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)) {
navigate({ pathname: URL.ADMIN_SCHEDULE });
} else {
navigate({pathname: URL.ERROR}, {state: {msg : resp.resultMessage}});
}
}
);
}
}
const formValidator = (formData) => {
if (formData.get('schdulNm') === null || formData.get('schdulNm') === "") {
alert("일정명은 필수 값입니다.");
return false;
}
if (formData.get('schdulCn') === null || formData.get('schdulCn') === "") {
alert("일정내용은 필수 값입니다.");
return false;
}
if (formData.get('schdulSe') === null || formData.get('schdulSe') === "") {
alert("일정구분은 필수 값입니다.");
return false;
}
if (formData.get('schdulIpcrCode') === null || formData.get('schdulIpcrCode') === "") {
alert("중요도는 필수 값입니다.");
return false;
}
if (formData.get('reptitSeCode') === null ||formData.get('reptitSeCode') === "") {
alert("반복구분은 필수 값입니다.");
return false;
}
if (formData.get('schdulBgnde') > formData.get('schdulEndde')) {
alert("종료일시는 시작일시보다 앞 설 수 없습니다.");
return false;
}
return true;
}
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();
}
useEffect(function () {
initMode();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
console.log("------------------------------EgovAdminScheduleEdit [End]");
console.groupEnd("EgovAdminScheduleEdit");
return (
<div className="container">
<div className="c_wrap">
{/* <!-- Location --> */}
<div className="location">
<ul>
<li><Link to={URL.MAIN} className="home">Home</Link></li>
<li><Link to={URL.ADMIN}>사이트 관리</Link></li>
<li>위원회 관리</li>
</ul>
</div>
{/* <!--// Location --> */}
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav></EgovLeftNav>
{/* <!--// Navigation --> */}
<div className="contents SITE_SCHDULE_REG" id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">위원회 일정 관리</h1>
</div>
{/* <!-- <h2 className="tit_2">위원회 일정 추가</h2> --> */}
{/* <!-- 게시판 상세보기 --> */}
<div className="board_view2">
<dl>
<dt>일정구분<span className="req">필수</span></dt>
<dd>
<label className="f_select w_130" htmlFor="schdulSe">
<select id="schdulSe" name="schdulSe" title="일정구분"
value={scheduleDetail.schdulSe}
onChange={(e) => setScheduleDetail({ ...scheduleDetail, schdulSe: e.target.value })}>
<option value="">선택</option>
<option value="1">회의</option>
<option value="2">세미나</option>
<option value="3">강의</option>
<option value="4">교육</option>
<option value="5">기타</option>
</select>
</label>
</dd>
</dl>
<dl>
<dt>중요도<span className="req">필수</span></dt>
<dd>
<label className="f_select w_130" htmlFor="schdulIpcrCode">
<select id="schdulIpcrCode" name="schdulIpcrCode" title="중요도"
value={scheduleDetail.schdulIpcrCode}
onChange={(e) => setScheduleDetail({ ...scheduleDetail, schdulIpcrCode: e.target.value })}>
<option value="">선택</option>
<option value="A">높음</option>
<option value="B">보통</option>
<option value="C">낮음</option>
</select>
</label>
</dd>
</dl>
<dl>
<dt><label htmlFor="schdulDeptName">부서</label><span className="req">필수</span></dt>
<dd>
<input className="f_input2 w_full" type="text" name="schdulDeptName" title="부서" id="schdulDeptName"
value={scheduleDetail.schdulDeptName} readOnly
/>
</dd>
</dl>
<dl>
<dt><label htmlFor="schdulNm">일정명</label><span className="req">필수</span></dt>
<dd>
<input className="f_input2 w_full" type="text" name="schdulNm" title="부서" id="schdulNm" placeholder="일정 테스트"
defaultValue={scheduleDetail.schdulNm}
onChange={(e) => setScheduleDetail({ ...scheduleDetail, schdulNm: e.target.value })} />
</dd>
</dl>
<dl>
<dt><label htmlFor="schdulCn">일정내용</label><span className="req">필수</span></dt>
<dd>
<textarea className="f_txtar w_full h_100" name="schdulCn" id="schdulCn" cols="30" rows="10" placeholder="일정내용"
defaultValue={scheduleDetail.schdulCn}
onChange={(e) => setScheduleDetail({ ...scheduleDetail, schdulCn: e.target.value })}
></textarea>
</dd>
</dl>
<dl>
<dt>반복구분<span className="req">필수</span></dt>
<dd>
<EgovRadioButtonGroup
name="reptitSeCode"
radioGroup={reptitSeCodeRadioGroup}
setValue={scheduleDetail.reptitSeCode.trim()}
setter={(v) => setScheduleDetail({ ...scheduleDetail, reptitSeCode: v })} />
</dd>
</dl>
<dl>
<dt>날짜/시간<span className="req">필수</span></dt>
<dd className="datetime">
<span className="line_break">
<DatePicker
selected={scheduleDetail.startDate}
name="schdulBgnde"
className="f_input"
dateFormat="yyyy-MM-dd HH:mm"
showTimeInput
onChange={(date) => {
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());
}} />
<input type="hidden" name="schdulBgndeHH" defaultValue={schdulBgndeHH} readOnly />
<input type="hidden" name="schdulBgndeMM" defaultValue={schdulBgndeMM} readOnly />
<span className="f_inn_txt">~</span>
</span>
<span className="line_break">
<DatePicker
selected={scheduleDetail.endDate}
name="schdulEndde"
className="f_input"
dateFormat="yyyy-MM-dd HH:mm"
showTimeInput
minDate={scheduleDetail.startDate}
onChange={(date) => {
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());
}
} />
<input type="hidden" name="schdulEnddeHH" defaultValue={schdulEnddeHH} readOnly />
<input type="hidden" name="schdulEnddeMM" defaultValue={schdulEnddeMM} readOnly />
</span>
</dd>
</dl>
<dl>
<dt><label htmlFor="schdulChargerName">담당자</label><span className="req">필수</span></dt>
<dd>
<input className="f_input2 w_full" type="text" name="schdulChargerName" id="schdulChargerName" defaultValue="관리자" readOnly
/>
</dd>
</dl>
<EgovAttachFile
fnChangeFile={(attachfile) => {
console.log("====>>> Changed attachfile file = ", attachfile);
const arrayConcat = { ...scheduleDetail}; // ( for)
for ( let i = 0; i < attachfile.length; i++) {
arrayConcat[`file_${i}`] = attachfile[i];
}
setScheduleDetail(arrayConcat);
}}
fnDeleteFile={(deletedFile) => {
console.log("====>>> Delete deletedFile = ", deletedFile);
setBoardAttachFiles(deletedFile);
}}
boardFiles={boardAttachFiles}
mode={props.mode} />
{/* <!-- 버튼영역 --> */}
<div className="board_btn_area">
<div className="left_col btn1">
<button className="btn btn_skyblue_h46 w_100"
onClick={() => updateSchedule()}
> 저장</button>
<a href="#!" className="btn btn_skyblue_h46 w_100">삭제</a>
</div>
<div className="right_col btn1">
<Link to={URL.ADMIN_SCHEDULE} className="btn btn_blue_h46 w_100">목록</Link>
</div>
</div>
{/* <!--// 버튼영역 --> */}
</div>
{/* <!-- 게시판 상세보기 --> */}
{/* <!--// 본문 --> */}
</div>
</div>
</div>
</div >
);
}
export default SchedulesEdit;

View File

@ -0,0 +1,313 @@
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 SchedulesList(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(
<tr key={keyIdx++}>{
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 (
<td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
{
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 (
<>
<Link to={{pathname: URL.ADMIN_SCHEDULE_DETAIL}}
state={{schdulId : schedule.schdulId}}
key={keyIdx++}>{schedule.schdulNm}
</Link>
<br />
</>
);
} else return <></>
})
}
</td>
);
} else {//
return (
<td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br />
</td>);
}
} else if (day === 0) {// /
return (<td key={keyIdx++}></td>);
} else return <></>
})
}</tr>);
})
console.log("mutCalendarTagList : ", mutCalendarTagList);
setCalendarTag(mutCalendarTagList);
console.groupEnd("EgovAdminScheduleList.drawCalendar()");
}
const Location = React.memo(function Location() {
return (
<div className="location">
<ul>
<li><Link to={URL.MAIN} className="home">Home</Link></li>
<li><Link to={URL.ADMIN}>사이트관리</Link></li>
<li>일정관리</li>
</ul>
</div>
)
});
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 (
<div className="container">
<div className="c_wrap">
{/* <!-- Location --> */}
<Location />
{/* <!--// Location --> */}
<div className="layout">
{/* <!-- Navigation --> */}
<EgovLeftNav></EgovLeftNav>
{/* <!--// Navigation --> */}
<div className="contents NOTICE_LIST" id="contents">
{/* <!-- 본문 --> */}
<div className="top_tit">
<h1 className="tit_1">사이트관리</h1>
</div>
<h2 className="tit_2">일정관리</h2>
{/* <!-- 검색조건 --> */}
<div className="condition">
<ul>
<li>
<label className="f_select" htmlFor="sel1">
<select name="schdulSe" id="sel1" title="조건"
onChange={e => {
setSearchCondition({ ...searchCondition, schdulSe: e.target.value });
}}
>
<option value="">전체</option>
<option value="1">회의</option>
<option value="2">세미나</option>
<option value="3">강의</option>
<option value="4">교육</option>
<option value="5">기타</option>
</select>
</label>
</li>
<li className="half L">
<button className="prev"
onClick={() => {
changeDate(CODE.DATE_YEAR, -1);
}}
></button>
<span>{searchCondition.year}</span>
<button className="next"
onClick={() => {
changeDate(CODE.DATE_YEAR, 1);
}}
></button>
</li>
<li className="half R">
<button className="prev"
onClick={() => {
changeDate(CODE.DATE_MONTH, -1);
}}
></button>
<span>{(searchCondition.month + 1)}</span>
<button className="next"
onClick={() => {
changeDate(CODE.DATE_MONTH, 1);
}}
></button>
</li>
</ul>
</div>
{/* <!--// 검색조건 --> */}
<div className="calendar_list">
<table>
<thead>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{calendarTag}
</tbody>
</table>
</div>
{/* <!--// 본문 --> */}
</div>
</div>
</div>
</div>
);
}
export default SchedulesList;

View File

@ -6,7 +6,7 @@ import URL from 'constants/url';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
function StandardsResearch(props) { function StandardResearch(props) {
const Location = React.memo(function Location() { const Location = React.memo(function Location() {
return ( return (
@ -47,4 +47,4 @@ function StandardsResearch(props) {
); );
} }
export default StandardsResearch; export default StandardResearch;

View File

@ -1,27 +1,29 @@
import React, { useState, useEffect, useCallback } from 'react'; import React, {useState, useEffect, useCallback, PureComponent} from 'react';
import { Link, useLocation } from 'react-router-dom'; import {Link, useLocation} from 'react-router-dom';
import {BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer} from 'recharts';
import * as EgovNet from 'api/egovFetch'; import * as EgovNet from 'api/egovFetch';
import URL from 'constants/url'; import URL from 'constants/url';
import CODE from 'constants/code'; import CODE from 'constants/code';
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin'; import {default as EgovLeftNav} from 'components/leftmenu/EgovLeftNavAdmin';
function EgovAdminScheduleList(props) { function EgovAdminScheduleList(props) {
console.group("EgovAdminScheduleList"); console.group("EgovAdminScheduleList");
console.log("[Start] EgovAdminScheduleList ------------------------------"); console.log("[Start] EgovAdminScheduleList ------------------------------");
console.log("EgovAdminScheduleList [props] : ", props); console.log("EgovAdminScheduleList [props] : ", props);
const location = useLocation(); const location = useLocation();
console.log("EgovAdminScheduleList [location] : ", location); console.log("EgovAdminScheduleList [location] : ", location);
const DATE = new Date(); const DATE = new Date();
const TODAY = new Date(DATE.getFullYear(), DATE.getMonth(), DATE.getDate()); 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 [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || {schdulSe: '', year: TODAY.getFullYear(), month: TODAY.getMonth(), date: TODAY.getDate()});
const [calendarTag, setCalendarTag] = useState([]); const [calendarTag, setCalendarTag] = useState([]);
const [scheduleList, setScheduleList] = useState([]); const [scheduleList, setScheduleList] = useState([]);
const [dailyUserLogList, setDailyUserLogList] = useState([]);
const innerConsole = (...args) => { const innerConsole = (...args) => {
console.log(...args); console.log(...args);
@ -45,14 +47,14 @@ function EgovAdminScheduleList(props) {
if (target === CODE.DATE_MONTH) { if (target === CODE.DATE_MONTH) {
changedDate = new Date(searchCondition.year, searchCondition.month + amount, searchCondition.date); changedDate = new Date(searchCondition.year, searchCondition.month + amount, searchCondition.date);
} }
setSearchCondition({ ...searchCondition, year: changedDate.getFullYear(), month: changedDate.getMonth(), date: changedDate.getDate() }); setSearchCondition({...searchCondition, year: changedDate.getFullYear(), month: changedDate.getMonth(), date: changedDate.getDate()});
} }
const retrieveList = useCallback((srchcnd) => { const retrieveList = useCallback((srchcnd) => {
console.groupCollapsed("EgovAdminScheduleList.retrieveList()"); console.groupCollapsed("EgovAdminScheduleList.retrieveList()");
const retrieveListURL = '/schedule/month'+EgovNet.getQueryString(srchcnd); const retrieveListURL = '/schedule/month' + EgovNet.getQueryString(srchcnd);
const requestOptions = { const requestOptions = {
method: "GET", method: "GET",
headers: { headers: {
@ -70,7 +72,7 @@ function EgovAdminScheduleList(props) {
} }
); );
console.groupEnd("EgovAdminScheduleList.retrieveList()"); console.groupEnd("EgovAdminScheduleList.retrieveList()");
},[]); }, []);
const drawCalendar = () => { const drawCalendar = () => {
console.groupCollapsed("EgovAdminScheduleList.drawCalendar()"); console.groupCollapsed("EgovAdminScheduleList.drawCalendar()");
@ -138,7 +140,7 @@ function EgovAdminScheduleList(props) {
let mutCalendarTagList = []; let mutCalendarTagList = [];
let keyIdx = 0; let keyIdx = 0;
//draw Calendar //draw Calendar
monthArr.forEach((week, weekIdx) => { monthArr.forEach((week, weekIdx) => {
console.log(); console.log();
@ -151,7 +153,8 @@ function EgovAdminScheduleList(props) {
if (scheduleList.length > 0) {// if (scheduleList.length > 0) {//
return ( return (
<td key={keyIdx++}> <td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br /> <Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
key={keyIdx++}>{day}</Link><br/>
{ {
scheduleList.map((schedule, scheduleIdx) => { scheduleList.map((schedule, scheduleIdx) => {
let iBeginDate = Number(schedule.schdulBgnde.substring(0, 8)); let iBeginDate = Number(schedule.schdulBgnde.substring(0, 8));
@ -161,11 +164,11 @@ function EgovAdminScheduleList(props) {
if (iUseDate >= iBeginDate && iUseDate <= iEndDate) { if (iUseDate >= iBeginDate && iUseDate <= iEndDate) {
return ( return (
<> <>
<Link to={{pathname: URL.ADMIN_SCHEDULE_DETAIL}} <Link to={{pathname: URL.ADMIN_SCHEDULE_DETAIL}}
state={{schdulId : schedule.schdulId}} state={{schdulId: schedule.schdulId}}
key={keyIdx++}>{schedule.schdulNm} key={keyIdx++}>{schedule.schdulNm}
</Link> </Link>
<br /> <br/>
</> </>
); );
} else return <></> } else return <></>
@ -176,7 +179,8 @@ function EgovAdminScheduleList(props) {
} else {// } else {//
return ( return (
<td key={keyIdx++}> <td key={keyIdx++}>
<Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate : mutsUseYearMonth + sDate + "000000"}} className="day" key={keyIdx++}>{day}</Link><br /> <Link to={{pathname: URL.ADMIN_SCHEDULE_CREATE}} state={{iUseDate: mutsUseYearMonth + sDate + "000000"}} className="day"
key={keyIdx++}>{day}</Link><br/>
</td>); </td>);
} }
} else if (day === 0) {// / } else if (day === 0) {// /
@ -190,7 +194,7 @@ function EgovAdminScheduleList(props) {
console.groupEnd("EgovAdminScheduleList.drawCalendar()"); console.groupEnd("EgovAdminScheduleList.drawCalendar()");
} }
const Location = React.memo(function Location() { const Location = React.memo(function Location() {
return ( return (
<div className="location"> <div className="location">
<ul> <ul>
@ -204,21 +208,123 @@ function EgovAdminScheduleList(props) {
useEffect(() => { useEffect(() => {
retrieveList(searchCondition); retrieveList(searchCondition);
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchCondition]); }, [searchCondition]);
useEffect(() => { useEffect(() => {
drawCalendar(); drawCalendar();
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [scheduleList]); }, [scheduleList]);
const getDailyUserLogList = useCallback(() => {
console.groupCollapsed("EgovAdminScheduleList.getDailyUserLogList()");
const dailyUserLogListURL = '/admin/dashboard/daily-user-log-list';
const requestOptions = {
method: "GET",
headers: {
'Content-type': 'application/json',
}
}
EgovNet.requestFetch(dailyUserLogListURL,
requestOptions,
(resp) => {
setDailyUserLogList(resp.result.dailyUserLogList);
console.log("@@@ : " + dailyUserLogList);
},
function (resp) {
console.log("err response : ", resp);
}
);
console.groupEnd("EgovAdminScheduleList.getDailyUserLogList()");
}, []);
useEffect(() => {
getDailyUserLogList();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const data = dailyUserLogList.map(item => ({
logDt: item.logDt,
uv: item.mobileCnt,
"사용자 접속현황": item.logCnt,
amt: item.pcCnt,
}));
const getIntroOfPage = (label) => {
if (label === 'Page A') {
return "Page A is about men's clothing";
}
if (label === 'Page B') {
return "Page B is about women's dress";
}
if (label === 'Page C') {
return "Page C is about women's bag";
}
if (label === 'Page D') {
return 'Page D is about household goods';
}
if (label === 'Page E') {
return 'Page E is about food';
}
if (label === 'Page F') {
return 'Page F is about baby food';
}
return '';
};
const CustomTooltip = ({active, payload, label}) => {
if (active && payload && payload.length) {
return (
<div className="custom-tooltip">
<p className="desc">사용자 접속 현황</p>
<p className="label">{`${label} : ${payload[0].value}`}</p>
<p className="intro">{getIntroOfPage(label)}</p>
</div>
);
}
return null;
};
class Example extends PureComponent {
static demoUrl = 'https://codesandbox.io/s/tooltip-with-customized-content-lyxvs';
render() {
return (
<ResponsiveContainer width="100%" height="100%">
<BarChart
width={500}
height={300}
data={data}
margin={{
top: 5,
right: 30,
left: 20,
bottom: 5,
}}
>
<CartesianGrid strokeDasharray="3 3"/>
<XAxis dataKey="logDt"/>
<YAxis/>
<Tooltip content={<CustomTooltip/>}/>
<Legend/>
<Bar dataKey="사용자 접속현황" barSize={20} fill="#87CEFA"/>
</BarChart>
</ResponsiveContainer>
);
}
}
console.log("------------------------------EgovAdminScheduleList [End]"); console.log("------------------------------EgovAdminScheduleList [End]");
console.groupEnd("EgovAdminScheduleList"); console.groupEnd("EgovAdminScheduleList");
return ( return (
<div className="container"> <div className="container">
<div className="c_wrap"> <div className="c_wrap">
{/* <!-- Location --> */} {/* <!-- Location --> */}
<Location /> <Location/>
{/* <!--// Location --> */} {/* <!--// Location --> */}
<div className="layout"> <div className="layout">
@ -235,15 +341,19 @@ function EgovAdminScheduleList(props) {
<h2 className="tit_2">일정관리</h2> <h2 className="tit_2">일정관리</h2>
<div style={{width: 1000, height: 300}}>
<Example/>
</div>
{/* <!-- 검색조건 --> */} {/* <!-- 검색조건 --> */}
<div className="condition"> <div className="condition">
<ul> <ul>
<li> <li>
<label className="f_select" htmlFor="sel1"> <label className="f_select" htmlFor="sel1">
<select name="schdulSe" id="sel1" title="조건" <select name="schdulSe" id="sel1" title="조건"
onChange={e => { onChange={e => {
setSearchCondition({ ...searchCondition, schdulSe: e.target.value }); setSearchCondition({...searchCondition, schdulSe: e.target.value});
}} }}
> >
<option value="">전체</option> <option value="">전체</option>
<option value="1">회의</option> <option value="1">회의</option>
@ -256,28 +366,28 @@ function EgovAdminScheduleList(props) {
</li> </li>
<li className="half L"> <li className="half L">
<button className="prev" <button className="prev"
onClick={() => { onClick={() => {
changeDate(CODE.DATE_YEAR, -1); changeDate(CODE.DATE_YEAR, -1);
}} }}
></button> ></button>
<span>{searchCondition.year}</span> <span>{searchCondition.year}</span>
<button className="next" <button className="next"
onClick={() => { onClick={() => {
changeDate(CODE.DATE_YEAR, 1); changeDate(CODE.DATE_YEAR, 1);
}} }}
></button> ></button>
</li> </li>
<li className="half R"> <li className="half R">
<button className="prev" <button className="prev"
onClick={() => { onClick={() => {
changeDate(CODE.DATE_MONTH, -1); changeDate(CODE.DATE_MONTH, -1);
}} }}
></button> ></button>
<span>{(searchCondition.month + 1)}</span> <span>{(searchCondition.month + 1)}</span>
<button className="next" <button className="next"
onClick={() => { onClick={() => {
changeDate(CODE.DATE_MONTH, 1); changeDate(CODE.DATE_MONTH, 1);
}} }}
></button> ></button>
</li> </li>
</ul> </ul>
@ -287,18 +397,18 @@ function EgovAdminScheduleList(props) {
<div className="calendar_list"> <div className="calendar_list">
<table> <table>
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{calendarTag} {calendarTag}
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -91,12 +91,14 @@ import AdminStandardsInfoDisclosure from 'pages/admin/standards/InfoDisclosure';
// - // -
import AdminContentsSurvey from 'pages/admin/contents/Survey'; // - / import AdminContentsSurvey from 'pages/admin/contents/Survey'; // - /
import AdminContentsPopUp from 'pages/admin/contents/PopUp'; // - / import AdminContentsPopUp from 'pages/admin/contents/PopUp'; // - /
import AdminContentsStandardsResearch from 'pages/admin/contents/StandardsResearch'; // - / import AdminContentsStandardResearch from 'pages/admin/contents/StandardResearch'; // - /
import AdminContentsTextMessages from 'pages/admin/contents/TextMessages'; // - / import AdminContentsTextMessages from 'pages/admin/contents/TextMessages'; // - /
// - // -
import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // - / import AdminCommitteeProgressStatus from 'pages/admin/committee/ProgressStatus'; // - /
import AdminCommitteeSchedules from 'pages/admin/committee/Schedules'; // - / import AdminCommitteeSchedules from 'pages/admin/committee/Schedules'; // - /
import AdminCommitteeSchedulesDetail from 'pages/admin/committee/Schedules/Detail'; // - / /
import AdminCommitteeSchedulesEdit from 'pages/admin/committee/Schedules/Edit'; // - / /
// - // -
import AdminLogsMenuAccessInfo from 'pages/admin/logs/MenuAccessInfo'; // - / import AdminLogsMenuAccessInfo from 'pages/admin/logs/MenuAccessInfo'; // - /
@ -291,12 +293,17 @@ const SecondRoutes = () => {
{/* 관리자 - 컨텐츠 관리 */} {/* 관리자 - 컨텐츠 관리 */}
<Route path={URL.ADMIN__CONTENTS__SURVEY} element={<AdminContentsSurvey />} /> <Route path={URL.ADMIN__CONTENTS__SURVEY} element={<AdminContentsSurvey />} />
<Route path={URL.ADMIN__CONTENTS__POP_UP} element={<AdminContentsPopUp />} /> <Route path={URL.ADMIN__CONTENTS__POP_UP} element={<AdminContentsPopUp />} />
<Route path={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH} element={<AdminContentsStandardsResearch />} /> <Route path={URL.ADMIN__CONTENTS__STANDARD_RESEARCH} element={<AdminContentsStandardResearch />} />
<Route path={URL.ADMIN__CONTENTS__TEXT_MESSAGES} element={<AdminContentsTextMessages />} /> <Route path={URL.ADMIN__CONTENTS__TEXT_MESSAGES} element={<AdminContentsTextMessages />} />
{/* 관리자 - 위원회 관리 */} {/* 관리자 - 위원회 관리 */}
<Route path={URL.ADMIN__COMMITTEE__PROGRESS_STATUS} element={<AdminCommitteeProgressStatus />} /> <Route path={URL.ADMIN__COMMITTEE__PROGRESS_STATUS} element={<AdminCommitteeProgressStatus />} />
<Route path={URL.ADMIN__COMMITTEE__SCHEDULES} element={<AdminCommitteeSchedules />} /> <Route path={URL.ADMIN__COMMITTEE__SCHEDULES} element={<AdminCommitteeSchedules />} />
<Route path={URL.ADMIN__COMMITTEE__SCHEDULES__DETAIL} element={<AdminCommitteeSchedulesDetail />} />
<Route path={URL.ADMIN__COMMITTEE__SCHEDULES__CREATE} element={<AdminCommitteeSchedulesEdit mode={CODE.MODE_CREATE} />} />
<Route path={URL.ADMIN__COMMITTEE__SCHEDULES__MODIFY} element={<AdminCommitteeSchedulesEdit mode={CODE.MODE_MODIFY} />} />
{/* 관리자 - 로그 관리 */} {/* 관리자 - 로그 관리 */}
<Route path={URL.ADMIN__LOGS__MENU_ACCESS_INFO} element={<AdminLogsMenuAccessInfo />} /> <Route path={URL.ADMIN__LOGS__MENU_ACCESS_INFO} element={<AdminLogsMenuAccessInfo />} />

View File

@ -0,0 +1,55 @@
package com.dbnt.kcscbackend.admin.dashboard;
import com.dbnt.kcscbackend.admin.dashboard.service.AdminDashboardService;
import com.dbnt.kcscbackend.config.common.BaseController;
import com.dbnt.kcscbackend.config.common.ResultVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequiredArgsConstructor
@RequestMapping("/admin/dashboard")
@Tag(name="AdminDashboardController", description = "사이트관리 대시보드")
public class AdminDashboardController extends BaseController {
private final AdminDashboardService adminDashboardService;
@Operation(
summary = "기본코드 그룹 조회",
description = "기본코드 그룹 조회",
tags = {"AdminConfigController"}
)
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "조회 성공"),
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
})
@RequestMapping(method = RequestMethod.GET, value = "/daily-user-log-list", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResultVO getDailyUserLogList() throws Exception {
ResultVO resultVO = new ResultVO();
Map<String, Object> resultMap = new HashMap<>();
// 현재 날짜
// todo endDate 뒤에 .minus 지워야함
LocalDate endDate = LocalDate.now().minusMonths(6);
System.out.println("@@@ localdate : " + endDate);
// 3개월 전 날짜 계산
LocalDate startDate = endDate.minusMonths(3);
resultMap.put("dailyUserLogList", adminDashboardService.selectDailyUserLogList(startDate, endDate));
resultVO.setResult(resultMap);
return resultVO;
}
}

View File

@ -0,0 +1,36 @@
package com.dbnt.kcscbackend.admin.dashboard.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.time.LocalDate;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "tn_daily_user_log")
public class TnDailyUserLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "dul_seq")
private Long dulSeq;
@Column(name = "log_dt")
private LocalDate logDt;
@Column(name = "log_cnt")
private Integer logCnt;
@Column(name = "mobile_cnt")
private Integer mobileCnt;
@Column(name = "pc_cnt")
private Integer pcCnt;
}

View File

@ -0,0 +1,11 @@
package com.dbnt.kcscbackend.admin.dashboard.repository;
import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
import org.springframework.data.jpa.repository.JpaRepository;
import java.time.LocalDate;
import java.util.List;
public interface TnDailyUserLogRepository extends JpaRepository<TnDailyUserLog, Long> {
List<TnDailyUserLog> findByLogDtBetweenOrderByLogDt(LocalDate startDate, LocalDate endDate);
}

View File

@ -0,0 +1,20 @@
package com.dbnt.kcscbackend.admin.dashboard.service;
import com.dbnt.kcscbackend.admin.dashboard.entity.TnDailyUserLog;
import com.dbnt.kcscbackend.admin.dashboard.repository.TnDailyUserLogRepository;
import lombok.RequiredArgsConstructor;
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.List;
@Service
@RequiredArgsConstructor
public class AdminDashboardService extends EgovAbstractServiceImpl {
private final TnDailyUserLogRepository tnDailyUserLogRepository;
public List<TnDailyUserLog> selectDailyUserLogList(LocalDate startDate, LocalDate endDate) {
return tnDailyUserLogRepository.findByLogDtBetweenOrderByLogDt(startDate, endDate);
}
}