Compare commits
No commits in common. "a4a33196cfede9749e16ece8ff5d973e27a0b563" and "4642e5d8206b479ba9efb4b0fffe6ea132150217" have entirely different histories.
a4a33196cf
...
4642e5d820
|
|
@ -4,7 +4,7 @@
|
||||||
NODE_PATH=src/
|
NODE_PATH=src/
|
||||||
|
|
||||||
## 절대경로 지정
|
## 절대경로 지정
|
||||||
REACT_APP_EGOV_CONTEXT_URL=https://back.kcsc.dbnt.co.kr
|
REACT_APP_EGOV_CONTEXT_URL=118.219.150.34:50688
|
||||||
|
|
||||||
## [보안] 소스맵 삭제
|
## [보안] 소스맵 삭제
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,6 @@ function App() {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("process.env.NODE_ENV", process.env.NODE_ENV);
|
console.log("process.env.NODE_ENV", process.env.NODE_ENV);
|
||||||
console.log("process.env.REACT_APP_EGOV_CONTEXT_URL", "[" + process.env.REACT_APP_EGOV_CONTEXT_URL + "]");
|
console.log("process.env.REACT_APP_EGOV_CONTEXT_URL", process.env.REACT_APP_EGOV_CONTEXT_URL);
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ SimpleDialog.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function LoadingProgress({open, setOpen}) {
|
export default function LoadingProgress({open, setOpen}) {
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SimpleDialog
|
<SimpleDialog
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
export const SERVER_URL = String(process.env.REACT_APP_EGOV_CONTEXT_URL).indexOf('http') !== -1 ? process.env.REACT_APP_EGOV_CONTEXT_URL : "http://"+process.env.REACT_APP_EGOV_CONTEXT_URL; // REST API 서버 Domain URL
|
export const SERVER_URL = "http://"+process.env.REACT_APP_EGOV_CONTEXT_URL; // REST API 서버 Domain URL
|
||||||
export const DEFAULT_BBS_ID = "BBSMSTR_AAAAAAAAAAAA"; // default = 공지사항 게시판 아이디
|
export const DEFAULT_BBS_ID = "BBSMSTR_AAAAAAAAAAAA"; // default = 공지사항 게시판 아이디
|
||||||
export const NOTICE_BBS_ID = "BBSMSTR_AAAAAAAAAAAA"; // 공지사항 게시판 아이디
|
export const NOTICE_BBS_ID = "BBSMSTR_AAAAAAAAAAAA"; // 공지사항 게시판 아이디
|
||||||
export const GALLERY_BBS_ID = "BBSMSTR_BBBBBBBBBBBB"; // 갤러리 게시판 아이디
|
export const GALLERY_BBS_ID = "BBSMSTR_BBBBBBBBBBBB"; // 갤러리 게시판 아이디
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import {default as EgovLeftNav} from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
import EgovRadioButtonGroup from 'components/EgovRadioButtonGroup';
|
import EgovRadioButtonGroup from 'components/EgovRadioButtonGroup';
|
||||||
import {Form} from "react-bootstrap";
|
import {Form} from "react-bootstrap";
|
||||||
import RichTextEditor from "../../../components/editor/RichTextEditor";
|
import RichTextEditor from "../../../components/editor/RichTextEditor";
|
||||||
import AttachFile from "../../../components/file/AttachFile";
|
|
||||||
|
|
||||||
|
|
||||||
function AdminPostMgtEdit({props, reloadFunction}) {
|
function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
|
|
@ -35,31 +34,27 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
const [categoryList, setCategoryList] = useState([]);
|
const [categoryList, setCategoryList] = useState([]);
|
||||||
|
|
||||||
const retrieveList = useCallback(() => {
|
const retrieveList = useCallback(() => {
|
||||||
const retrieveListURL = '/admin/boards/get-category-and-file-list';
|
const retrieveListURL = '/admin/boards/get-category-list';
|
||||||
|
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: "POST",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-type': 'application/json',
|
'Content-type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(item ? item : {})
|
body: JSON.stringify()
|
||||||
}
|
}
|
||||||
|
|
||||||
EgovNet.requestFetch(retrieveListURL,
|
EgovNet.requestFetch(retrieveListURL,
|
||||||
requestOptions,
|
requestOptions,
|
||||||
(resp) => {
|
(resp) => {
|
||||||
setCategoryList(resp.result.categoryList);
|
setCategoryList(resp.result.categoryList);
|
||||||
if (resp.result.files) {
|
|
||||||
setServerFiles(resp.result.files);
|
|
||||||
console.log("@@@ files : " + JSON.stringify(resp.result.files));
|
|
||||||
}
|
|
||||||
console.log("@@@ categoryList : " + JSON.stringify(resp.result.categoryList));
|
console.log("@@@ categoryList : " + JSON.stringify(resp.result.categoryList));
|
||||||
},
|
},
|
||||||
function (resp) {
|
function (resp) {
|
||||||
console.log("err response : ", resp);
|
console.log("err response : ", resp);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, []);
|
},[]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
retrieveList();
|
retrieveList();
|
||||||
|
|
@ -70,40 +65,33 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
const initMode = () => {
|
const initMode = () => {
|
||||||
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
||||||
setBoardDetail(item);
|
setBoardDetail(item);
|
||||||
setSelectedBbsSeq(props?.bbsSeq);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function editPost(e) {
|
function editPost(e) {
|
||||||
const formData = new FormData();
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
const form = e.target;
|
const form = e.target;
|
||||||
formData.append('fixedYn', defaultFixedYn);
|
const info = {
|
||||||
formData.append('secretYn', defaultSecretYn);
|
fixedYn: defaultFixedYn,
|
||||||
formData.append('bbsId', form.bbsId.value);
|
secretYn: defaultSecretYn,
|
||||||
formData.append('bbsSeq', selectedBbsSeq);
|
bbsId: form.bbsId.value,
|
||||||
formData.append('bbsContTitle', form.bbsContTitle.value);
|
bbsSeq: selectedBbsSeq,
|
||||||
formData.append('bbsContents', text);
|
bbsContTitle: form.bbsContTitle.value,
|
||||||
//첨부파일
|
fileGrpId: form.fileGrpId.value,
|
||||||
if (files) {
|
bbsContents: text
|
||||||
for (let i = 0; i < files.length; i++) {
|
|
||||||
if (files[i].seq) {
|
|
||||||
// 살아남은 file의 seq 목록 서버로 보내면 서버가 알아서 기존파일을 정리해준다.
|
|
||||||
formData.append("survivingFiles", files[i].seq);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
formData.append("files", files[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
||||||
formData.append('bbsContSeq', props.bbsContSeq);
|
info.bbsContSeq = props.bbsContSeq;
|
||||||
}
|
}
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/boards/post-mgt',
|
'/admin/boards/post-mgt',
|
||||||
{
|
{
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
body: formData
|
headers: {
|
||||||
|
'Content-type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify(info)
|
||||||
},
|
},
|
||||||
(resp) => {
|
(resp) => {
|
||||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||||
|
|
@ -118,8 +106,8 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function deletePost(post) {
|
function deletePost(post){
|
||||||
if (window.confirm("삭제하시겠습니까?")) {
|
if(window.confirm("삭제하시겠습니까?")) {
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/admin/boards/post-mgt',
|
'/admin/boards/post-mgt',
|
||||||
{
|
{
|
||||||
|
|
@ -157,28 +145,6 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
setSelectedBbsSeq(selectedOption.bbsSeq);
|
setSelectedBbsSeq(selectedOption.bbsSeq);
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileTypes = ["JPG", "PNG", "GIF", "PDF", "HWP", "HWPX", "ZIP", "JPEG", "MP4", "TXT"];
|
|
||||||
const [serverFiles, setServerFiles] = useState([]);
|
|
||||||
const [files, setFiles] = useState([]);
|
|
||||||
|
|
||||||
// 첨부된 file을 삭제하는 요청
|
|
||||||
const deleteFile = (fileSeq) => {
|
|
||||||
const deleteFileURL = `/contents/api/popup-manage/file/${fileSeq}`;
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
method: "DELETE",
|
|
||||||
headers: {
|
|
||||||
'Content-type': 'application/json',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EgovNet.requestFetch(deleteFileURL,
|
|
||||||
requestOptions,
|
|
||||||
(resp) => {
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -198,9 +164,7 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
|
|
||||||
<Modal.Body>
|
<Modal.Body>
|
||||||
<div className="board_view2">
|
<div className="board_view2">
|
||||||
<Form onSubmit={(e) => {
|
<Form onSubmit={(e) => {editPost(e)}} noValidate>
|
||||||
editPost(e)
|
|
||||||
}} noValidate>
|
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label htmlFor="siteTitle">상단고정</label><span className="req">필수</span></dt>
|
<dt><label htmlFor="siteTitle">상단고정</label><span className="req">필수</span></dt>
|
||||||
<dd>
|
<dd>
|
||||||
|
|
@ -244,13 +208,14 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label htmlFor="fileGrpId">파일</label><span className="req">필수</span></dt>
|
<dt><label htmlFor="siteUrl">파일</label><span className="req">필수</span></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<AttachFile name="preDataFile" multiple={true} files={files} setFiles={setFiles} serverFiles={serverFiles} fileTypes={fileTypes} deleteFile={deleteFile}/>
|
<Form.Control className="f_input2 w_full" type="text" name="fileGrpId" placeholder="파일" required
|
||||||
|
defaultValue={props?.fileGrpId}/>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label htmlFor="contents">내용</label><span className="req">필수</span></dt>
|
<dt><label htmlFor="fileGrpId">내용</label><span className="req">필수</span></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<RichTextEditor item={text} setText={setText}/>
|
<RichTextEditor item={text} setText={setText}/>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
@ -262,17 +227,12 @@ function AdminPostMgtEdit({props, reloadFunction}) {
|
||||||
<button type="submit" className="btn btn_skyblue_h46 w_100">저장
|
<button type="submit" className="btn btn_skyblue_h46 w_100">저장
|
||||||
</button>
|
</button>
|
||||||
{modeInfo.mode === CODE.MODE_MODIFY &&
|
{modeInfo.mode === CODE.MODE_MODIFY &&
|
||||||
<button type={"button"} className="btn btn_skyblue_h46 w_100" onClick={() => {
|
<button type={"button"} className="btn btn_skyblue_h46 w_100" onClick={()=>{deletePost(props)}}>삭제</button>
|
||||||
deletePost(props)
|
|
||||||
}}>삭제</button>
|
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="right_col btn1">
|
<div className="right_col btn1">
|
||||||
<button type={"button"} className="btn btn_blue_h46 w_100" onClick={() => {
|
<button type={"button"} className="btn btn_blue_h46 w_100" onClick={()=>{reloadFunction()}}>목록</button>
|
||||||
reloadFunction()
|
|
||||||
}}>목록
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// 버튼영역 --> */}
|
{/* <!--// 버튼영역 --> */}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import AboutSiteModal from "../config/aboutSiteMgt/AboutSiteModal";
|
||||||
import AdminPostMgtEdit from "./AdminPostMgtEdit";
|
import AdminPostMgtEdit from "./AdminPostMgtEdit";
|
||||||
import Modal from "react-bootstrap/Modal";
|
import Modal from "react-bootstrap/Modal";
|
||||||
import {format} from "date-fns";
|
import {format} from "date-fns";
|
||||||
import {Form} from "react-bootstrap";
|
|
||||||
|
|
||||||
function AdminPostMgtList(props) {
|
function AdminPostMgtList(props) {
|
||||||
console.group("EgovAdminPostList");
|
console.group("EgovAdminPostList");
|
||||||
|
|
@ -31,7 +30,6 @@ function AdminPostMgtList(props) {
|
||||||
const wrdRef = useRef();
|
const wrdRef = useRef();
|
||||||
|
|
||||||
const [listTag, setListTag] = useState([]);
|
const [listTag, setListTag] = useState([]);
|
||||||
const [categoryList, setCategoryList] = useState([]);
|
|
||||||
|
|
||||||
const [show, setShow] = useState(false);
|
const [show, setShow] = useState(false);
|
||||||
const [modalBody, setModalBody] = useState();
|
const [modalBody, setModalBody] = useState();
|
||||||
|
|
@ -57,7 +55,6 @@ function AdminPostMgtList(props) {
|
||||||
requestOptions,
|
requestOptions,
|
||||||
(resp) => {
|
(resp) => {
|
||||||
setPaginationInfo(resp.result.paginationInfo);
|
setPaginationInfo(resp.result.paginationInfo);
|
||||||
setCategoryList(resp.result.categoryList);
|
|
||||||
|
|
||||||
let mutListTag = [];
|
let mutListTag = [];
|
||||||
listTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // 게시판 목록 초기값
|
listTag.push(<p className="no_data" key="0">검색된 결과가 없습니다.</p>); // 게시판 목록 초기값
|
||||||
|
|
@ -95,10 +92,6 @@ function AdminPostMgtList(props) {
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleSelectChange = (e) => {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function editPost(item){
|
function editPost(item){
|
||||||
handleShow();
|
handleShow();
|
||||||
if(item != undefined) {
|
if(item != undefined) {
|
||||||
|
|
@ -141,12 +134,14 @@ function AdminPostMgtList(props) {
|
||||||
<li className="third_1 L">
|
<li className="third_1 L">
|
||||||
<span className="lb">검색유형선택</span>
|
<span className="lb">검색유형선택</span>
|
||||||
<label className="f_select" htmlFor="searchCnd">
|
<label className="f_select" htmlFor="searchCnd">
|
||||||
<Form.Select id="select1" name="bbsId" onChange={handleSelectChange}>
|
<select id="searchCnd" name="searchCnd" title="검색유형선택" ref={cndRef}
|
||||||
<option value="">선택</option>
|
onChange={e => {
|
||||||
{categoryList.map((item) => (
|
cndRef.current.value = e.target.value;
|
||||||
<option key={item.bbsSeq} value={item.bbsId} selected={props?.bbsId === item.bbsId}>{item.bbsTitle}</option>
|
}}
|
||||||
))}
|
>
|
||||||
</Form.Select>
|
<option value="0">게시판명</option>
|
||||||
|
<option value="1">게시판유형</option>
|
||||||
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li className="third_2 R">
|
<li className="third_2 R">
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link, useLocation, useNavigate } from 'react-router-dom';
|
||||||
import LinearProgress from '@mui/material/LinearProgress';
|
|
||||||
|
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
|
||||||
|
|
@ -28,13 +27,13 @@ const StyledDiv = styled.div`
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
&:nth-child(4) {
|
&:nth-child(4) {
|
||||||
width: 110px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
&:nth-child(5) {
|
&:nth-child(5) {
|
||||||
width: 70px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
&:nth-child(6) {
|
&:nth-child(6) {
|
||||||
width: 60px;
|
width: 70px;
|
||||||
}
|
}
|
||||||
&:nth-child(7) {
|
&:nth-child(7) {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|
@ -61,13 +60,13 @@ const StyledDiv = styled.div`
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
&:nth-child(4) {
|
&:nth-child(4) {
|
||||||
width: 110px;
|
width: 120px;
|
||||||
}
|
}
|
||||||
&:nth-child(5) {
|
&:nth-child(5) {
|
||||||
width: 70px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
&:nth-child(6) {
|
&:nth-child(6) {
|
||||||
width: 60px;
|
width: 70px;
|
||||||
}
|
}
|
||||||
&:nth-child(7) {
|
&:nth-child(7) {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
|
|
@ -78,18 +77,6 @@ const StyledDiv = styled.div`
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-name {
|
|
||||||
color: #001574;
|
|
||||||
padding: 0px 0px 3px 0px;
|
|
||||||
border-bottom: 0px solid #e8e8e8;
|
|
||||||
&:hover {
|
|
||||||
border-bottom: 1px solid #001574;
|
|
||||||
}
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,7 +108,7 @@ function ProgressStatus(props) {
|
||||||
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
|
||||||
const [listItem, setListItem] = useState();
|
const [listItem, setListItem] = useState([]);
|
||||||
const [paginationInfo, setPaginationInfo] = useState({});
|
const [paginationInfo, setPaginationInfo] = useState({});
|
||||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
|
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
|
||||||
|
|
||||||
|
|
@ -194,21 +181,16 @@ function ProgressStatus(props) {
|
||||||
<span>수정</span>
|
<span>수정</span>
|
||||||
<span>삭제</span>
|
<span>삭제</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="result">
|
<div className="result">
|
||||||
{/* <!-- case : 데이터 없을때 --> */}
|
{/* <!-- case : 데이터 없을때 --> */}
|
||||||
{typeof listItem === 'undefined' &&
|
{listItem.length === 0 &&
|
||||||
<p className="no_data" key="0"><LinearProgress /></p>
|
|
||||||
}
|
|
||||||
{listItem && listItem.length === 0 &&
|
|
||||||
<p className="no_data" key="0">검색된 결과가 없습니다.</p>
|
<p className="no_data" key="0">검색된 결과가 없습니다.</p>
|
||||||
}
|
}
|
||||||
{listItem && listItem.map((it)=>(
|
{listItem.map((it)=>(
|
||||||
<div className='list_item' key={it.seq}>
|
<div className='list_item' key={it.seq}>
|
||||||
<div>{it.number}</div>
|
<div>{it.number}</div>
|
||||||
<div>{it.drftTypeNm}</div>
|
<div>{it.drftTypeNm}</div>
|
||||||
<div>{it.categoryNm}<br /><Link to={URL.ADMIN__COMMITTEE__PROGRESS_STATUS__DETAIL} state={{drftSeq: it.seq}} className="code-name">{it.title}</Link></div>
|
<div>{it.categoryNm}<br /><Link to={URL.ADMIN__COMMITTEE__PROGRESS_STATUS__DETAIL} state={{drftSeq: it.seq}} className="home">{it.title}</Link></div>
|
||||||
<div>{it.orgNm}</div>
|
<div>{it.orgNm}</div>
|
||||||
<div>진행단계표시</div>
|
<div>진행단계표시</div>
|
||||||
<div>{it.regDate}</div>
|
<div>{it.regDate}</div>
|
||||||
|
|
@ -217,8 +199,6 @@ function ProgressStatus(props) {
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// 게시판목록 --> */}
|
{/* <!--// 게시판목록 --> */}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ import CODE from 'constants/code';
|
||||||
|
|
||||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
import ReferenceCodePopupInput from './ReferenceCodePopupInput';
|
|
||||||
|
|
||||||
|
|
||||||
import styled from "styled-components";
|
import styled from "styled-components";
|
||||||
import { makeStyles } from "@mui/styles";
|
import { makeStyles } from "@mui/styles";
|
||||||
|
|
||||||
|
|
@ -379,9 +376,9 @@ function ProgressStatusEdit(props) {
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label>기준코드</label><span className="req">필수</span></dt>
|
<dt><label>기준코드</label><span className="req">필수</span></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<ReferenceCodePopupInput
|
<input className="f_input2 w_full" type="text" name="categoryId" title="기준코드" placeholder="여기를 눌러 기준코드를 선택하세요"
|
||||||
requestItems={requestItems}
|
value={requestItems.categoryId}
|
||||||
setRequestItems={setRequestItems}
|
onChange={(e) => setRequestItems({ ...requestItems, categoryId: e.target.value })}
|
||||||
/>
|
/>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
|
||||||
|
|
@ -1,65 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import PropTypes from 'prop-types';
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import { Dialog, DialogContent, makeStyles, Theme, Typography } from "@material-ui/core";
|
|
||||||
|
|
||||||
import ReferenceCodePopupDialogCotents from './ReferenceCodePopupDialogCotents';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
|
||||||
backDrop: {
|
|
||||||
backdropFilter: "blur(3px)",
|
|
||||||
backgroundColor:'rgba(0,0,30,0.4)'
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
function SimpleDialog(props) {
|
|
||||||
|
|
||||||
const classes = useStyles();
|
|
||||||
|
|
||||||
const { onClose, open } = props;
|
|
||||||
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
onClose();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Dialog
|
|
||||||
open={open}
|
|
||||||
onClose={handleClose}
|
|
||||||
disableEscapeKeyDown={false}
|
|
||||||
BackdropProps={{
|
|
||||||
classes: {
|
|
||||||
root: classes.backDrop,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<DialogContent style={{ textAlign: "center", background: 'rgba(0,0,0,0)' }}>
|
|
||||||
<Box sx={{ display: 'flex', width: '100%', padding: '0px' }}>
|
|
||||||
<ReferenceCodePopupDialogCotents />
|
|
||||||
</Box>
|
|
||||||
</DialogContent>
|
|
||||||
</Dialog>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
SimpleDialog.propTypes = {
|
|
||||||
onClose: PropTypes.func.isRequired,
|
|
||||||
open: PropTypes.bool.isRequired,
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function ReferenceCodePopupDialog({open, setOpen}) {
|
|
||||||
|
|
||||||
const handleClose = () => {
|
|
||||||
setOpen(false);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<SimpleDialog
|
|
||||||
open={open}
|
|
||||||
onClose={handleClose}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,263 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import { styled, ThemeProvider, createTheme } from '@mui/material/styles';
|
|
||||||
import List from '@mui/material/List';
|
|
||||||
import ListItemButton from '@mui/material/ListItemButton';
|
|
||||||
import ListItemText from '@mui/material/ListItemText';
|
|
||||||
import Paper from '@mui/material/Paper';
|
|
||||||
|
|
||||||
import ListSubheader from '@mui/material/ListSubheader';
|
|
||||||
|
|
||||||
import ReferenceCodePopupDialogCotentsHeader from './ReferenceCodePopupDialogCotentsHeader';
|
|
||||||
import ReferenceCodePopupDialogCotentsListItem from './ReferenceCodePopupDialogCotentsListItem';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const data = [
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 00 00",
|
|
||||||
codeName: '설계기준',
|
|
||||||
depth: 1,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 10 00",
|
|
||||||
codeName: '공통편',
|
|
||||||
depth: 2,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 10 00",
|
|
||||||
codeName: '공통편',
|
|
||||||
depth: 3,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 00 00",
|
|
||||||
codeName: '공통 설계기준',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 20 00",
|
|
||||||
codeName: '지반 설계 기준',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 12 00 00",
|
|
||||||
codeName: '건설측량 설계기준',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 14 00 00",
|
|
||||||
codeName: '구조 설계기준',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 17 00 00",
|
|
||||||
codeName: '내진 설계기준',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 20 00",
|
|
||||||
codeName: '시설물편',
|
|
||||||
depth: 3,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "TEST 17 00 00",
|
|
||||||
codeName: 'test',
|
|
||||||
depth: 4,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
codeTitle: "KDS 10 20 00",
|
|
||||||
codeName: '시설물편',
|
|
||||||
depth: 2,
|
|
||||||
children: [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ codeTitle: "KCS 20 00 00", codeName: '표준시방서', depth: 1, },
|
|
||||||
{ codeTitle: "SMCS 40 00 00", codeName: '서울시 전문시방서', depth: 1, },
|
|
||||||
{ codeTitle: "EXCS 50 00 00", codeName: '고속도로공사 전문시방서', depth: 1, },
|
|
||||||
{ codeTitle: "KRCCS 60 00 00", codeName: '농업생산기반시설 전문시방서', depth: 1, },
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
const FireNav = styled(List)({
|
|
||||||
'& .MuiListItemButton-root': {
|
|
||||||
paddingLeft: 0,
|
|
||||||
paddingRight: 0,
|
|
||||||
background: '#fafafa',
|
|
||||||
},
|
|
||||||
'& .MuiListItemIcon-root': {
|
|
||||||
minWidth: 0,
|
|
||||||
marginRight: 16,
|
|
||||||
},
|
|
||||||
'& .MuiSvgIcon-root': {
|
|
||||||
fontSize: 20,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
export default function ReferenceCodePopupDialogCotents() {
|
|
||||||
|
|
||||||
const [selectedValue, setSelectedValue] = React.useState('a');
|
|
||||||
|
|
||||||
const handleChange = (event) => {
|
|
||||||
setSelectedValue(event.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box sx={{ display: 'flex' }}>
|
|
||||||
<ThemeProvider
|
|
||||||
theme={createTheme({
|
|
||||||
components: {
|
|
||||||
MuiListItemButton: {
|
|
||||||
defaultProps: {
|
|
||||||
disableTouchRipple: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
palette: {
|
|
||||||
mode: 'dark',
|
|
||||||
primary: { main: 'rgb(102, 157, 246)' },
|
|
||||||
background: { paper: 'rgb(5, 30, 52)' },
|
|
||||||
},
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
<Paper elevation={0} sx={{ maxWidth: 520 }}>
|
|
||||||
<FireNav component="nav" disablePadding>
|
|
||||||
<ListItemButton component="a" href="#customized-list">
|
|
||||||
<ListItemText
|
|
||||||
sx={{ my: 0 }}
|
|
||||||
primary="문서번호 또는 코드명을 선택 하시면 하위 문서를 검색 하실 수 있습니다"
|
|
||||||
primaryTypographyProps={{
|
|
||||||
backgroundColor: '#001e4f',
|
|
||||||
color: '#ffffff',
|
|
||||||
fontSize: 15,
|
|
||||||
fontWeight: 'medium',
|
|
||||||
letterSpacing: 0,
|
|
||||||
padding: '10px',
|
|
||||||
borderRadius: '6px',
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ListItemButton>
|
|
||||||
|
|
||||||
<List
|
|
||||||
sx={{ width: '100%', bgcolor: 'background.paper' }}
|
|
||||||
component="nav"
|
|
||||||
aria-labelledby="nested-list-subheader"
|
|
||||||
subheader={
|
|
||||||
<ListSubheader component="div" id="nested-list-subheader">
|
|
||||||
<ReferenceCodePopupDialogCotentsHeader />
|
|
||||||
</ListSubheader>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<ListItemButton>
|
|
||||||
<ReferenceCodePopupDialogCotentsListItem
|
|
||||||
data={data}
|
|
||||||
/>
|
|
||||||
</ListItemButton>
|
|
||||||
</List>
|
|
||||||
|
|
||||||
</FireNav>
|
|
||||||
</Paper>
|
|
||||||
</ThemeProvider>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import { styled, } from '@mui/material/styles';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ItemHeader = styled('div')(({ theme }) => ({
|
|
||||||
padding: theme.spacing(1),
|
|
||||||
borderRadius: '4px',
|
|
||||||
textAlign: 'left',
|
|
||||||
}));
|
|
||||||
|
|
||||||
export default function ReferenceCodePopupDialogCotentsHeader() {
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: 'grid',
|
|
||||||
gridAutoFlow: 'row',
|
|
||||||
gridTemplateColumns: 'auto 120px 90px',
|
|
||||||
gap: 1,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ItemHeader>문서번호</ItemHeader>
|
|
||||||
<ItemHeader>코드명</ItemHeader>
|
|
||||||
<ItemHeader sx={{textAlign: 'center'}}>선택</ItemHeader>
|
|
||||||
</Box>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,118 +0,0 @@
|
||||||
import * as React from 'react';
|
|
||||||
import List from '@mui/material/List';
|
|
||||||
import ListItem from '@mui/material/ListItem';
|
|
||||||
import ListItemButton from '@mui/material/ListItemButton';
|
|
||||||
import Divider from '@mui/material/Divider';
|
|
||||||
|
|
||||||
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
|
||||||
import RemoveIcon from '@mui/icons-material/Remove';
|
|
||||||
|
|
||||||
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import Collapse from '@mui/material/Collapse';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import { styled } from '@mui/material/styles';
|
|
||||||
|
|
||||||
|
|
||||||
const Item = styled('div')(({ theme }) => ({
|
|
||||||
padding: '0px',
|
|
||||||
borderRadius: '4px',
|
|
||||||
textAlign: 'left',
|
|
||||||
}));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const ItemComponent = (props) => {
|
|
||||||
const {item, index, openSelf} = props;
|
|
||||||
|
|
||||||
|
|
||||||
const [open, setOpen] = React.useState(false);
|
|
||||||
|
|
||||||
const handleClick = () => {
|
|
||||||
setOpen(!open);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Collapse in={openSelf} timeout="auto" unmountOnExit sx={{width: '100%'}}>
|
|
||||||
<ListItem disablePadding sx={{ width: '100%'}}>
|
|
||||||
<List sx={{ paddingTop: '0px', paddingBottom: '0px', width: '100%'}}>
|
|
||||||
<ListItem disablePadding sx={{ width: '100%'}}>
|
|
||||||
<ListItemButton onClick={handleClick} sx={{width: '100%'}}>
|
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: 'grid',
|
|
||||||
gridAutoFlow: 'row',
|
|
||||||
gridTemplateColumns: 'auto 120px 90px',
|
|
||||||
gap: 1,
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Item
|
|
||||||
sx={{paddingLeft: `${Number(Number(item.depth)-1) * 20}px`,}}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
item.children && item.children.length > 0
|
|
||||||
?
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
open
|
|
||||||
?
|
|
||||||
<RemoveIcon sx={{ color: '#777777', height: '30px;'}} />
|
|
||||||
:
|
|
||||||
<AddIcon sx={{ color: '#777777', height: '30px;'}} />
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
:
|
|
||||||
<span> </span>
|
|
||||||
}
|
|
||||||
{item.codeTitle}
|
|
||||||
</Item>
|
|
||||||
<Item>{item.codeName}</Item>
|
|
||||||
<Item sx={{textAlign: 'center'}}>
|
|
||||||
<button type="button" class="btn btn_blue_h31 px-1">선택</button>
|
|
||||||
</Item>
|
|
||||||
</Box>
|
|
||||||
</ListItemButton>
|
|
||||||
</ListItem>
|
|
||||||
{
|
|
||||||
item.children &&
|
|
||||||
item.children.map(function(item, index) {
|
|
||||||
//<div>item.codeTitle</div>
|
|
||||||
console.log('thkim 2024-03-21 11:29 %o', item);
|
|
||||||
return (
|
|
||||||
<ItemComponent item={item} index={index} openSelf={open} />
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</List>
|
|
||||||
</ListItem>
|
|
||||||
</Collapse>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export default function ReferenceCodePopupDialogCotentsListItem(props) {
|
|
||||||
const {data} = props;
|
|
||||||
const [selectedValue, setSelectedValue] = React.useState('a');
|
|
||||||
|
|
||||||
const handleChange = (event) => {
|
|
||||||
setSelectedValue(event.target.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
|
||||||
<List sx={{ paddingTop: '0px', paddingBottom: '0px', width: '100%'}}>
|
|
||||||
{
|
|
||||||
data &&
|
|
||||||
data.map(function(item, index) {
|
|
||||||
return (
|
|
||||||
<ItemComponent item={item} index={index} openSelf={true} />
|
|
||||||
);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</List>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
|
||||||
import ReferenceCodePopupDialog from './ReferenceCodePopupDialog'
|
|
||||||
|
|
||||||
|
|
||||||
import styled from "styled-components";
|
|
||||||
const StyledDiv = styled.div`
|
|
||||||
input {
|
|
||||||
background: #fafafa;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
|
|
||||||
function ReferenceCodePopupInput(props) {
|
|
||||||
const {requestItems,setRequestItems} = props;
|
|
||||||
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<StyledDiv>
|
|
||||||
<input className="f_input2 w_full" type="text" name="categoryId" title="기준코드 선택" placeholder="여기를 눌러 기준코드를 선택하세요"
|
|
||||||
|
|
||||||
value={requestItems.categoryId}
|
|
||||||
onChange={(e) => setRequestItems({ ...requestItems, categoryId: e.target.value })}
|
|
||||||
onClick={(e) => {
|
|
||||||
setOpen(true);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ReferenceCodePopupDialog open={open} setOpen={setOpen}/>
|
|
||||||
</StyledDiv>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ReferenceCodePopupInput;
|
|
||||||
|
|
@ -19,17 +19,9 @@ const StyledDiv = styled.div`
|
||||||
.head > span:nth-child(3) {
|
.head > span:nth-child(3) {
|
||||||
width: 180px;
|
width: 180px;
|
||||||
}
|
}
|
||||||
.result .list_item {
|
.result .list_item > div:nth-child(3) {
|
||||||
& > div {
|
width: 180px;
|
||||||
&:nth-child(3) {
|
|
||||||
width: 180px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.title {
|
|
||||||
color: #001574;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.board-bot {
|
.board-bot {
|
||||||
|
|
@ -170,7 +162,7 @@ function PopUp(props) {
|
||||||
{listPopup && listPopup.map((it)=>(
|
{listPopup && listPopup.map((it)=>(
|
||||||
<div className='list_item' key={it.seq}>
|
<div className='list_item' key={it.seq}>
|
||||||
<div>{it.number}</div>
|
<div>{it.number}</div>
|
||||||
<div className="al"><Link to={URL.ADMIN__CONTENTS__POP_UP__MODIFY} state={{popupId: it.seq} } key={it.seq} className='title'>{it.popupTitle}</Link></div>
|
<div className="al"><Link to={URL.ADMIN__CONTENTS__POP_UP__MODIFY} state={{popupId: it.seq} } key={it.seq}>{it.popupTitle}</Link></div>
|
||||||
<div>{it.startDate} ~ {it.endDate}</div>
|
<div>{it.startDate} ~ {it.endDate}</div>
|
||||||
<div>{it.useYn === 'Y' ? <Switch {...label} key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} defaultChecked /> : <Switch key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} {...label} />}</div>
|
<div>{it.useYn === 'Y' ? <Switch {...label} key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} defaultChecked /> : <Switch key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} {...label} />}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,6 @@ const StyledDiv = styled.div`
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
|
||||||
color: #001574;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -180,7 +176,7 @@ function StandardResearch(props) {
|
||||||
{list && list.map((it)=>(
|
{list && list.map((it)=>(
|
||||||
<div className='list_item' key={it.id}>
|
<div className='list_item' key={it.id}>
|
||||||
<div>{it.number}</div>
|
<div>{it.number}</div>
|
||||||
<div className="al"><Link to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH__MODIFY} state={{rsId: it.id} } key={it.id} className='title' >{it.title}</Link></div>
|
<div className="al"><Link to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH__MODIFY} state={{rsId: it.id} } key={it.id}>{it.title}</Link></div>
|
||||||
<div>{it.researchStartDate} ~ {it.researchEndDate}</div>
|
<div>{it.researchStartDate} ~ {it.researchEndDate}</div>
|
||||||
<div>{it.director}</div>
|
<div>{it.director}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ import com.dbnt.kcscbackend.config.common.BaseController;
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
import com.dbnt.kcscbackend.config.common.ResultVO;
|
||||||
import com.dbnt.kcscbackend.config.util.ClientUtils;
|
import com.dbnt.kcscbackend.config.util.ClientUtils;
|
||||||
import com.dbnt.kcscbackend.file.entity.TnAttachFile;
|
|
||||||
import com.dbnt.kcscbackend.file.service.FileService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
|
|
@ -22,15 +20,15 @@ import org.springframework.http.MediaType;
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
||||||
import org.springframework.validation.Errors;
|
import org.springframework.validation.Errors;
|
||||||
import org.springframework.validation.FieldError;
|
import org.springframework.validation.FieldError;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -41,7 +39,6 @@ public class AdminBoardsController extends BaseController {
|
||||||
|
|
||||||
private final AdminBoardsService adminBoardsService;
|
private final AdminBoardsService adminBoardsService;
|
||||||
private final CommonCodeService commonCodeService;
|
private final CommonCodeService commonCodeService;
|
||||||
private final FileService fileService;
|
|
||||||
|
|
||||||
/* ---- 게시판관리 ----- */
|
/* ---- 게시판관리 ----- */
|
||||||
@Operation(
|
@Operation(
|
||||||
|
|
@ -155,44 +152,27 @@ public class AdminBoardsController extends BaseController {
|
||||||
public ResultVO getPostList() throws Exception {
|
public ResultVO getPostList() throws Exception {
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
resultMap.put("categoryList", adminBoardsService.selectBoardList());
|
|
||||||
resultMap.put("postList", adminBoardsService.selectPostList());
|
resultMap.put("postList", adminBoardsService.selectPostList());
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(
|
@Operation(
|
||||||
summary = "게시물 카테고리 셀렉트박스 옵션, 파일 목록 조회",
|
summary = "게시물 카테고리 셀렉트박스 옵션 조회",
|
||||||
description = "게시물 카테고리 셀렉트박스 옵션, 파일 목록 조회",
|
description = "게시물 카테고리 셀렉트박스 옵션 조회",
|
||||||
tags = {"AdminBoardsController"}
|
tags = {"AdminBoardsController"}
|
||||||
)
|
)
|
||||||
@ApiResponses(value = {
|
@ApiResponses(value = {
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/get-category-and-file-list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(method = RequestMethod.GET, value = "/get-category-list", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
public ResultVO getCategoryList(@RequestBody TnBbsContents tnBbsContents) throws Exception {
|
public ResultVO getCategoryList() throws Exception {
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
||||||
resultMap.put("categoryList", adminBoardsService.selectBoardList());
|
resultMap.put("categoryList", adminBoardsService.selectBoardList());
|
||||||
//첨부파일명을 가져온다.
|
|
||||||
List<TnAttachFile> tnAttachFileList = fileService.findByFileGrpId(tnBbsContents.getFileGrpId());
|
|
||||||
System.out.println("@@@ fileGrpId : " + tnBbsContents.getFileGrpId());
|
|
||||||
|
|
||||||
if (tnAttachFileList != null) {
|
|
||||||
List<Map<String, Object>> files = new ArrayList<Map<String, Object>>();
|
|
||||||
for (TnAttachFile item : tnAttachFileList) {
|
|
||||||
Map<String, Object> fileDto = new HashMap<String, Object>();
|
|
||||||
fileDto.put("seq", item.getFileSeq());
|
|
||||||
fileDto.put("name", item.getFileOldName());
|
|
||||||
files.add(fileDto);
|
|
||||||
}
|
|
||||||
resultMap.put("files", files);
|
|
||||||
System.out.println("@@@ files : " + files);
|
|
||||||
} else {
|
|
||||||
resultMap.put("files", null);
|
|
||||||
}
|
|
||||||
resultVO.setResult(resultMap);
|
resultVO.setResult(resultMap);
|
||||||
return resultVO;
|
return resultVO;
|
||||||
}
|
}
|
||||||
|
|
@ -207,13 +187,7 @@ public class AdminBoardsController extends BaseController {
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||||
})
|
})
|
||||||
@RequestMapping(method = RequestMethod.PUT, value = "/post-mgt")
|
@RequestMapping(method = RequestMethod.PUT, value = "/post-mgt")
|
||||||
public ResultVO savePostMgt(
|
public ResultVO savePostMgt(@RequestBody @Valid TnBbsContents contents, HttpServletRequest request, Errors errors, @AuthenticationPrincipal LoginVO user) {
|
||||||
@Valid TnBbsContents contents,
|
|
||||||
HttpServletRequest request,
|
|
||||||
Errors errors,
|
|
||||||
@RequestParam(required = false) long[] survivingFiles,
|
|
||||||
@RequestParam(required = false) MultipartFile[] files,
|
|
||||||
@AuthenticationPrincipal LoginVO user) throws Exception {
|
|
||||||
ResultVO resultVO = new ResultVO();
|
ResultVO resultVO = new ResultVO();
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
resultVO.setResultCode(ResponseCode.TOKEN_EXPIRED.getCode());
|
||||||
|
|
@ -227,9 +201,9 @@ public class AdminBoardsController extends BaseController {
|
||||||
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
|
resultVO.setResultCode(ResponseCode.INPUT_CHECK_ERROR.getCode());
|
||||||
resultVO.setResultMessage(msg.toString());
|
resultVO.setResultMessage(msg.toString());
|
||||||
} else {
|
} else {
|
||||||
System.out.println("@@@ contents.getBbsSeq() : " + contents.getBbsSeq());
|
System.out.println("@@@ contents.getBbsSeq() : " + contents.getBbsContSeq());
|
||||||
contents.setIpAddress(ClientUtils.getRemoteIP(request));
|
contents.setIpAddress(ClientUtils.getRemoteIP(request));
|
||||||
adminBoardsService.savePost(contents, request, user, files, survivingFiles);
|
adminBoardsService.savePost(contents, user.getId());
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,19 +5,12 @@ import com.dbnt.kcscbackend.admin.boards.entity.TnBbsContents;
|
||||||
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsContentsRepository;
|
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsContentsRepository;
|
||||||
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsRepository;
|
import com.dbnt.kcscbackend.admin.boards.repository.TnBbsRepository;
|
||||||
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
import com.dbnt.kcscbackend.admin.config.entity.TcMenu;
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|
||||||
import com.dbnt.kcscbackend.file.entity.TnAttachFile;
|
|
||||||
import com.dbnt.kcscbackend.file.service.FileService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
@ -27,7 +20,6 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
|
||||||
|
|
||||||
private final TnBbsRepository tnBbsRepository;
|
private final TnBbsRepository tnBbsRepository;
|
||||||
private final TnBbsContentsRepository tnBbsContentsRepository;
|
private final TnBbsContentsRepository tnBbsContentsRepository;
|
||||||
private final FileService fileService;
|
|
||||||
|
|
||||||
public List<TnBbs> selectBoardList() {
|
public List<TnBbs> selectBoardList() {
|
||||||
return tnBbsRepository.findAllByOrderByBbsSeqDesc();
|
return tnBbsRepository.findAllByOrderByBbsSeqDesc();
|
||||||
|
|
@ -74,82 +66,28 @@ public class AdminBoardsService extends EgovAbstractServiceImpl {
|
||||||
return tnBbsContentsRepository.findAll();
|
return tnBbsContentsRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Transactional
|
||||||
* 파일이 저장될 중간 경로를 생성한다.
|
public void savePost(TnBbsContents contents, String userId) {
|
||||||
* D:/kcscUploadFiles/XXXX/abc.jpg XXXX에 해당하는 경로다.
|
|
||||||
*
|
|
||||||
* @return 중간 경로
|
|
||||||
*/
|
|
||||||
private String getMiddlePath() {
|
|
||||||
//파일이 저장될 경로를 생성한다.
|
|
||||||
String domainPath = "post";
|
|
||||||
Date nowDate = new Date();
|
|
||||||
String strNowYyyy = new SimpleDateFormat("yyyy").format(nowDate);
|
|
||||||
String strNowYyyyMmdd = new SimpleDateFormat("yyyyMMdd").format(nowDate);
|
|
||||||
String middlePath = domainPath + "/" + strNowYyyy + "/" + strNowYyyyMmdd + "/";
|
|
||||||
|
|
||||||
return middlePath;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void savePost(TnBbsContents contents, HttpServletRequest request, LoginVO user, MultipartFile[] files, long[] survivingFiles) throws Exception {
|
|
||||||
if (contents.getBbsContSeq() == null) {
|
if (contents.getBbsContSeq() == null) {
|
||||||
String fileGrpId = fileService.addTnAttachFile(request, user, files, this.getMiddlePath());
|
|
||||||
// TODO 하드코딩
|
// TODO 하드코딩
|
||||||
contents.setBbsContLevel(1L);
|
contents.setBbsContLevel(1L);
|
||||||
contents.setBbsReadCnt(0L);
|
contents.setBbsReadCnt(0L);
|
||||||
contents.setUseYn("Y");
|
contents.setUseYn("Y");
|
||||||
contents.setFrstCrtDt(LocalDateTime.now());
|
contents.setFrstCrtDt(LocalDateTime.now());
|
||||||
contents.setFrstCrtId(user.getId());
|
contents.setFrstCrtId(userId);
|
||||||
contents.setFileGrpId(fileGrpId);
|
|
||||||
tnBbsContentsRepository.save(contents);
|
tnBbsContentsRepository.save(contents);
|
||||||
} else {
|
} else {
|
||||||
TnBbsContents savedPost = tnBbsContentsRepository.findById(contents.getBbsContSeq()).orElse(null);
|
TnBbsContents savedPost = tnBbsContentsRepository.findById(contents.getBbsContSeq()).orElse(null);
|
||||||
|
|
||||||
String fileGrpId = savedPost.getFileGrpId();
|
|
||||||
List<TnAttachFile> tnAttachFileList = fileService.findByFileGrpId(fileGrpId);
|
|
||||||
if (survivingFiles == null) {
|
|
||||||
//기존 file을 모두 삭제한다.
|
|
||||||
if (fileGrpId != null) {
|
|
||||||
if (tnAttachFileList != null) {
|
|
||||||
for (TnAttachFile item : tnAttachFileList) {
|
|
||||||
fileService.deleteTnAttachFile(request, user, item.getFileSeq().longValue());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fileGrpId = null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 살아남은 file을 제외한 나머지 file을 삭제한다.
|
|
||||||
if (tnAttachFileList != null) {
|
|
||||||
boolean isFound = false;
|
|
||||||
for (TnAttachFile item : tnAttachFileList) {
|
|
||||||
for (long oldFileSeq : survivingFiles) {
|
|
||||||
if (oldFileSeq == item.getFileSeq()) {
|
|
||||||
isFound = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!isFound) {
|
|
||||||
fileService.deleteTnAttachFile(request, user, item.getFileSeq().longValue());
|
|
||||||
}
|
|
||||||
isFound = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
System.out.println("@@@ files : " + files);
|
|
||||||
fileGrpId = fileService.addTnAttachFile(request, user, files, this.getMiddlePath(), fileGrpId);
|
|
||||||
savedPost.setFixedYn(contents.getFixedYn());
|
savedPost.setFixedYn(contents.getFixedYn());
|
||||||
savedPost.setSecretYn(contents.getSecretYn());
|
savedPost.setSecretYn(contents.getSecretYn());
|
||||||
savedPost.setBbsId(contents.getBbsId());
|
savedPost.setBbsId(contents.getBbsId());
|
||||||
savedPost.setBbsSeq(contents.getBbsSeq());
|
|
||||||
savedPost.setBbsContTitle(contents.getBbsContTitle());
|
savedPost.setBbsContTitle(contents.getBbsContTitle());
|
||||||
savedPost.setFileGrpId(contents.getFileGrpId());
|
savedPost.setFileGrpId(contents.getFileGrpId());
|
||||||
savedPost.setBbsContents(contents.getBbsContents());
|
savedPost.setBbsContents(contents.getBbsContents());
|
||||||
savedPost.setIpAddress(contents.getIpAddress());
|
savedPost.setIpAddress(contents.getIpAddress());
|
||||||
savedPost.setUseYn("Y");
|
savedPost.setUseYn("Y");
|
||||||
savedPost.setLastChgId(user.getId());
|
savedPost.setLastChgId(userId);
|
||||||
savedPost.setLastChgDt(LocalDateTime.now());
|
savedPost.setLastChgDt(LocalDateTime.now());
|
||||||
savedPost.setFileGrpId(fileGrpId);
|
|
||||||
tnBbsContentsRepository.save(savedPost);
|
tnBbsContentsRepository.save(savedPost);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
# Access-Control-Allow-Origin
|
# Access-Control-Allow-Origin
|
||||||
Globals.Allow.Origin = https://back.dbnt.co.kr
|
Globals.Allow.Origin = http://118.219.150.34:50680/
|
||||||
|
|
||||||
server.port=50688
|
server.port=50688
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue