주요사건처리현황 2차

master
DESKTOP-QGC5RJO\DBNT 2023-01-06 14:00:33 +09:00
parent e7288d4ccd
commit 8ce4509d34
15 changed files with 197 additions and 175 deletions

View File

@ -48,6 +48,8 @@ public class BaseService {
protected String ciaEduPath;
@Value("${file.dir.activityCase}")
protected String activityCasePath;
@Value("${file.dir.majorStatus}")
protected String majorStatusPath;
protected String calculationSize(double fileSize){
String[] units = {"bytes", "KB", "MB", "GB", "TB", "PB"};

View File

@ -9,6 +9,7 @@ import com.dbnt.faisp.main.fpiMgt.affairPlan.service.PlanService;
import com.dbnt.faisp.main.fpiMgt.affairResult.service.ResultService;
import com.dbnt.faisp.main.fpiMgt.sri.service.SriService;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.service.BoardInvestigationService;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService;
import com.dbnt.faisp.main.publicBoard.service.PublicBoardService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
@ -44,6 +45,7 @@ public class FileController extends BaseService{
private final FishingBoatService fishingBoatService;
private final SriService sriService;
private final CounterIntelligenceService ciService;
private final MajorStatusService majorStatusService;
@GetMapping("/editorFileDisplay")
public ResponseEntity<Resource> editorFileDisplay(HttpServletRequest request,
@ -143,6 +145,9 @@ public class FileController extends BaseService{
case "ciWork":
downloadFile = ciService.selectCiWorkFile(parentKey, fileSeq);
break;
case "MajorFile" :
downloadFile = majorStatusService.selectMajorFile(parentKey, fileSeq);
break;
}
return downloadFile;
}

View File

@ -106,6 +106,7 @@ public class BoardInvestigationService extends BaseService {
}
}
private void deletIvsgtFile(Integer ivsgtKey, List<Integer> deleteFileSeq) {
List<IvsgtFile> ivsgtFileList = ivsgtFileRepository.findByIvsgtKey(ivsgtKey);
for(IvsgtFile file: ivsgtFileList){

View File

@ -3,7 +3,9 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.service.MajorStatusService;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
@ -50,23 +52,33 @@ public class MajorStatusController {
majorStatus = majorStatusService.selectMajor(majorStatus.getMajorKey());
}else{
majorStatus.setWrtOrgan(loginUser.getOgCd());
majorStatus.setWrtPart(loginUser.getOfcCd());
majorStatus.setWrtUserSeq(loginUser.getUserSeq());
majorStatus.setWrtUserGrd(loginUser.getTitleCd());
majorStatus.setWrtUserNm(loginUser.getUserNm());
majorStatus.setWrtDt(LocalDateTime.now());
majorStatus.setWrtDt(loginUser.getWrtDt());
majorStatus.setWrtDt(loginUser.getWrtDt());
}
mav.addObject("majorStatus", majorStatus);
mav.addObject("userSeq", loginUser.getUserSeq());
return mav;
}
@GetMapping("/majorViewModal")
public ModelAndView majorViewModal(@AuthenticationPrincipal UserInfo loginUser,MajorStatus majorStatus){
ModelAndView mav = null;
mav = new ModelAndView("ivsgt/majorStatus/majorStatusViewModal");
ModelAndView mav = new ModelAndView("ivsgt/majorStatus/majorStatusViewModal");
majorStatus = majorStatusService.selectMajor(majorStatus.getMajorKey());
mav.addObject("userSeq", loginUser.getUserSeq());
mav.addObject("major", majorStatus);
mav.addObject("majorStatus", majorStatus);
//메뉴권한 확인
// mav.addObject("accessAuth", authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/ivsgt/"+majorStatus.getMajorType()).get(0).getAccessAuth());
return mav;
}
@ -79,5 +91,12 @@ public class MajorStatusController {
}
@PostMapping("/deleteContent")
@ResponseBody
public void deleteContent(@AuthenticationPrincipal UserInfo loginUser, @RequestBody List<MajorStatus> majorStatuses){
majorStatusService.deleteContent(majorStatuses,loginUser);
}
}

View File

@ -14,7 +14,7 @@ import java.io.Serializable;
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "major_file")
@Table(name = "major_status_file")
@IdClass(MajorFile.MajorFileId.class)
public class MajorFile extends FileInfo {
@Id

View File

@ -4,4 +4,6 @@ import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import org.springframework.data.jpa.repository.JpaRepository;
public interface MajorStatusRepository extends JpaRepository<MajorStatus, Integer> {
void deleteByMajorKey(Integer majorKey);
}

View File

@ -3,17 +3,24 @@ package com.dbnt.faisp.main.ivsgtMgt.majorStatus.service;
import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseFile;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.BoardInvestigation;
import com.dbnt.faisp.main.ivsgtMgt.boardInvestigation.model.IvsgtFile;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.mapper.MajorStatusMapper;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorFile;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.model.MajorStatus;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorFileRepository;
import com.dbnt.faisp.main.ivsgtMgt.majorStatus.repository.MajorStatusRepository;
import com.dbnt.faisp.main.publicBoard.model.PublicBoard;
import com.dbnt.faisp.main.publicBoard.model.PublicComment;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.swing.*;
import java.io.File;
import java.util.List;
import java.util.UUID;
@ -35,14 +42,14 @@ public class MajorStatusService extends BaseService {
}
public MajorStatus selectMajor(Integer majorKey) {
MajorStatus savedBoardInvestigation = majorStatusRepository.findById(majorKey).orElse(null);
if (savedBoardInvestigation != null) {
savedBoardInvestigation.setFileList(majorFileRepository.findByMajorKey(majorKey));
// savedBoardInvestigation.setArrestType(majorStatusMapper.selectArrestType(majorKey));
// savedBoardInvestigation.setRelatedReportsList(majorStatusMapper.selectRelatedReportsList(majorKey));
}
return savedBoardInvestigation;
MajorStatus majorStatus= majorStatusRepository.findById(majorKey).orElse(null);
majorStatus.setFileList(majorFileRepository.findByMajorKey(majorKey));
// List<PublicComment> commentList = publicCommentRepository.findByPublicKeyAndParentCommentOrderByCommentKeyAsc(publicKey, null);
// for(PublicComment comment: commentList){
// comment.setChildCommentList(publicCommentRepository.findByPublicKeyAndParentCommentOrderByCommentKeyAsc(publicKey, comment.getCommentKey()));
// }
// publicBoard.setCommentList(commentList);
return majorStatus;
}
@Transactional
@ -57,27 +64,38 @@ public class MajorStatusService extends BaseService {
return majorKey;
}
private void saveUploadFiles(Integer majorkey, List<MultipartFile> multipartFileList) {
MajorFile lastFileInfo = majorFileRepository.findTopByMajorKeyOrderByFileSeq(majorkey).orElse(null);
private void saveUploadFiles(Integer majorKey, List<MultipartFile> multipartFileList){
MajorFile lastFileInfo = majorFileRepository.findTopByMajorKeyOrderByFileSeq(majorKey).orElse(null);
int fileSeq = lastFileInfo==null?1:(lastFileInfo.getFileSeq()+1);
for(MultipartFile file : multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+ File.separator+"major";
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
int extnIdx = originalFilename.lastIndexOf(".");
MajorFile fileInfo = new MajorFile();
fileInfo.setMajorKey(majorkey);
fileInfo.setMajorKey(majorKey);
fileInfo.setFileSeq(fileSeq++);
fileInfo.setOrigNm(originalFilename.substring(0, extnIdx));
fileInfo.setFileExtn(originalFilename.substring(extnIdx+1));
fileInfo.setConvNm(saveName);
fileInfo.setFileSize(calculationSize(file.getSize()));
fileInfo.setSavePath(path);
majorFileRepository.save(fileInfo);
}
}
public void deleteContent(List<MajorStatus> majorStatuses, UserInfo loginUser){
for(MajorStatus majorStatus : majorStatuses){
majorStatusRepository.deleteByMajorKey(majorStatus.getMajorKey());
}
}
private void deleteMajorFile(Integer majorKey, List<Integer> deleteFileSeq) {
List<MajorFile> majorFileList = majorFileRepository.findByMajorKey(majorKey);
for(MajorFile file: majorFileList){

View File

@ -26,6 +26,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -26,6 +26,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -25,6 +25,7 @@ file.dir.cia.company=/cia/company
file.dir.cia.foreigner=/cia/foreigner
file.dir.cia.edu=/cia/edu
file.dir.activityCase=/activityCase
file.dir.majorStatus=/majorStatus
editor.img.view=/file/editorFileDisplay?fileNm=

View File

@ -14,7 +14,7 @@
and a.wrt_organ = #{wrtOrgan}
</if>
<if test="contentTitle != null and contentTitle != ''">
AND a.content_title LIKE CONCAT('%', #{content_title}, '%')
AND a.content_title LIKE CONCAT('%', #{contentTitle}, '%')
</if>
<if test="wrtUserNm != null and wrtUserNm != ''">
AND a.wrt_user_nm LIKE CONCAT('%', #{wrtUserNm}, '%')
@ -42,13 +42,20 @@
a.content_info,
a.content_status,
a.wrt_user_grd,
a.wrt_user_seq,
a.wrt_user_nm,
a.wrt_dt,
a.wrt_organ,
wrt_user_seq,
wrt_part
a.wrt_part,
b.fileCnt
from major_status a
left outer join (select major_key,
count(file_seq) as fileCnt
from major_status_file
group by major_key) b
on a.major_key = b.major_key
<include refid="selectMajorListWhere"></include>
order by major_key desc
limit #{rowCnt} offset #{firstIndex}
@ -60,4 +67,6 @@
<include refid="selectMajorListWhere"></include>
</select>
</mapper>

View File

@ -1,4 +1,37 @@
$(document).on('click', '#addMajorBtn', function (){
getEditModal(null)
})
$(document).on('click', '.tr', function (){
$(".trChkBox").prop("checked", false);
$(this).find(".trChkBox").prop("checked", true);
getViewModal(Number($(this).find(".majorKey").val()));
})
// $(document).on('click', '.tr', function (event){
// const target = event.target;
// if(!(target.className === "cpChk" ||$(target).parents("td").length>0)){
// const phoneKey = (Number($(this).find(".phoneKey").val()));
// showModal(phoneKey);
// }
// });
$(document).on('click', '#saveBtn', function (){
saveContent("boardEditForm")
})
$(document).on('click', '#editBtn', function (){
$("#MajorViewModal").modal('hide')
getEditModal($(this).attr("data-majorkey"));
})
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
@ -7,89 +40,63 @@ $(function(){
});
})
// $(document).on('click', '#commentSaveBtn', function (){
// if(!$("#comment").val()) {
// alert("댓글을 입력해주세요.")
// }else{
// if (confirm("등록하시겠습니까?")) {
// contentFade("in")
// const formData = new FormData($("#commentForm")[0]);
// $.ajax({
// type : 'POST',
// data : formData,
// url : "/publicBoard/saveComment",
// processData: false,
// contentType: false,
// dataType:"html",
// beforeSend: function (xhr){
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
// },
// success : function(html) {
// const parentComment = $("#parentComment");
// if(!parentComment.val()){
// $("#commentDiv").append(html)
// }else{
// $("#childComment"+parentComment.val()).append(html);
// }
// commentFormReset();
// alert("저장되었습니다.");
// contentFade("out");
// },
// error : function(xhr, status) {
// alert("저장에 실패하였습니다.")
// contentFade("out");
// }
// })
// }
$(document).on('click', '#delectMajorBtn', function (){
if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
const checkArr = [];
$('input:checkbox[name=equChk]:checked').each(function (idx, el){
checkArr.push({});
const target = $(el);
checkArr[idx].equKey = Number(target.parents('tr').find('.majorKey').val());
})
deleteMajor(checkArr);
}
})
// $(document).on('click', '#deleteEquip', function (){
// if(confirm("선택한 대상을 삭제처리 하시겠습니까?")){
// const checkArr = [];
// checkArr.push({});
// checkArr[0].equKey = Number($('#mEquKey').val());
// deleteEquip(checkArr);
// }
// })
// $(document).on('click', '.childCommentBtn', function (){
// const childCommentFormDiv = $(this).parents(".commentRow").find(".childCommentFormDiv")
// childCommentFormDiv.show();
// $("#parentComment").val($(this).parents(".commentRow").find(".commentKey").val());
// $("#childFormRemoveBtn").show();
// childCommentFormDiv.empty().append($("#commentForm"))
// })
// $(document).on('click', '#childFormRemoveBtn', function (){
// commentFormReset();
// })
// $(document).on('click', '.deleteCommentBtn', function (){
// const commentRow = $(this).parents(".commentRow");
// const publicKey = Number(commentRow.find(".publicKey").val());
// const commentKey = Number(commentRow.find(".commentKey").val());
// $.ajax({
// type : 'POST',
// data : JSON.stringify({publicKey: publicKey, commentKey: commentKey}),
// url : "/publicBoard/deleteComment",
// contentType: 'application/json',
// beforeSend: function (xhr){
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
// },
// success : function(result) {
// commentRow.remove();
// $("#childComment"+commentKey).remove();
// alert("삭제되었습니다.");
// contentFade("out");
// },
// error : function(xhr, status) {
// alert("삭제를 실패하였습니다.")
// contentFade("out");
// }
// })
// })
function deleteMajor(checkArr){
$.ajax({
type : 'POST',
url : "/ivsgt/deleteContent",
data : JSON.stringify(checkArr),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function() {
alert("삭제처리 되었습니다.");
location.reload();
},
error : function(xhr, status) {
alert("삭제처리에 실패하였습니다");
}
})
}
function getEditModal(majorKey, majorType){
function getEditModal(majorKey){
$.ajax({
url: '/ivsgt/majorEditModal',
data: {majorKey: majorKey, majorType:majorType},
data: {majorKey: majorKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#editContent").empty().append(html)
$("#editContent").empty().append(html);
setUploadDiv();
setEditor('editor', '570');
$("#majorEditModal").modal('show');
$("#MajorEditModal").modal('show');
},
error:function(){
@ -97,15 +104,15 @@ function getEditModal(majorKey, majorType){
});
}
function getViewModal(majorKey, majorType){
function getViewModal(majorKey){
$.ajax({
url: '/ivsgt/majorViewModal',
data: {majorKey: majorKey, majorType: majorType},
data: {majorKey: majorKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#viewContent").empty().append(html)
$("#majorViewModal").modal('show');
$("#MajorViewModal").modal('show');
},
error:function(){
@ -126,7 +133,7 @@ function saveContent(formId, majorType){
$(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq"));
})
formData.append('content', CrossEditor.GetBodyValue());
formData.append('contentInfo', CrossEditor.GetBodyValue());
$.ajax({
type : 'POST',
data : formData,
@ -136,8 +143,8 @@ function saveContent(formId, majorType){
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
$("#editModal").modal('hide');
getViewModal(result, majorType);
$("#MajorEditModal").modal('hide');
getViewModal(result);
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
@ -150,16 +157,11 @@ function saveContent(formId, majorType){
function contentCheck(formId){
let flag = true;
if(!$("#title").val()){
if(!$("#contentTitle").val()){
alert("제목을 입력해주세요.")
flag = false;
}
if($("#majorType").val()==="PLB003"){
if(!$("#tabStatus").val()){
alert("분류를 선택해주세요.")
flag = false;
}
}
flag = fileCheck(flag, files);
return flag;
}
@ -174,23 +176,3 @@ function commentFormReset(){
$(document).on('click', '#addMajorBtn', function (){
getEditModal(null)
})
$(document).on('click', '.planTr', function (){
$(".trChkBox").prop("checked", false);
$(this).find(".trChkBox").prop("checked", true);
getViewModal(Number($(this).find(".planKey").val()));
})
$(document).on('click', '#saveBtn', function (){
savePublicBoard("boardEditForm")
})
$(document).on('click', '#editBtn', function (){
$("#MajorStatusViewModal").modal('hide')
getEditModal($(this).attr("data-ciwkey"));
})

View File

@ -1,20 +1,20 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="MajorEditModalLabel" th:text="${majorStatus.majorKey eq null?'주요사건 작성':'주요사건 수정'}"></h5>
<h5 class="modal-title text-white" id="MajorEditModalLabel" th:text="${majorStatus.majorKey eq null?'주요사건처리현황 작성':'주요사건처리현황 게시글 수정'}"></h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="MajorEditBody">
<form action="#" method="post" id="boardEditForm">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<!--<input type="hidden" name="majorKey" th:value="${majorStatus.majorKey}">
<input type="hidden" name="majorKey" th:value="${majorStatus.majorKey}">
<input type="hidden" name="majorType" th:value="${majorStatus.majorType}">
<input type="hidden" name="wrtOrgan" th:value="${majorStatus.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${majorStatus.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${majorStatus.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${majorStatus.wrtUserGrd}">
<input type="hidden" name="wrtUserNm" th:value="${majorStatus.wrtUserNm}">-->
<input type="hidden" name="wrtUserNm" th:value="${majorStatus.wrtUserNm}">
<div class="row mb-1">
<label for="wrtUserNm" class="col-sm-2 col-form-label text-center">작성자</label>
<div class="col-sm-2">
@ -29,18 +29,18 @@
<input type="text" class="form-control" id="wrtDt" name="wrtDt" th:value="${#temporals.format(majorStatus.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
<!-- <div class="col-sm-auto my-auto">-->
<!-- <input type="checkbox" id="organChk" name="organChk" value="T" th:checked="${major.organChk eq 'T'}">-->
<!-- <input type="checkbox" id="organChk" name="organChk" value="T" th:checked="${majorStatus.organChk eq 'T'}">-->
<!-- </div>-->
<!-- <label for="organChk" class="col-sm-3 col-form-label text-left">소속관서에만 노출</label>-->
</div>
<div class="row mb-1">
<label for="title" class="col-sm-2 col-form-label text-center">제목</label>
<label for="contentTitle" class="col-sm-2 col-form-label text-center">제목</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="title" name="title" th:value="${majorStatus.contentTitle}" autocomplete="off">
<input type="text" class="form-control" id="contentTitle" name="contentTitle" th:value="${majorStatus.contentTitle}" autocomplete="off">
</div>
</div>
<div class="row mb-1 justify-content-center">
<label for="content" class="col-sm-2 col-form-label text-center">내용</label>
<label for="editor" class="col-sm-2 col-form-label text-center">내용</label>
<div class="col-sm-10">
<div id="editor"></div>
<textarea id="content" class="d-none" th:utext="${majorStatus.contentInfo}"></textarea>
@ -55,7 +55,7 @@
</th:block>
<!-- <th:block th:unless="${#arrays.isEmpty(majorStatus.fileList)}">-->
<!-- <div class='row-col-6' th:each="infoFile:${majorStatus.fileList}">-->
<!-- <span th:data-fileseq="${majorFile.fileSeq}" th:text="|${majorFile.origNm}.${majorFile.fileExtn} ${majorFile.fileSize}|"></span>-->
<!-- <span th:data-fileseq="${majorFile.fileSeq}" th:text="|${majorFile.origNm}.${majorFile.fileExtn} $majorFile.fileSize}|"></span>-->
<!-- <a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>-->
<!-- </div>-->
<!-- </th:block>-->

View File

@ -40,7 +40,7 @@
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.contentTitle}">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="contentTitle" th:value="${searchParams.contentTitle}">
</div>
<div class="col-4">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
@ -76,7 +76,7 @@
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="" th:each="major:${majorList}">
<tr class="tr" th:each="major:${majorList}">
<input type="hidden" class="majorKey" th:value="${major.majorKey}">
<td><input type="checkbox" class="trChkBox"></td>
<td th:test="${major.majorType}"></td>
@ -126,6 +126,7 @@
</nav>
</div>
<div class="col-auto">
<!-- <input type="button" class="btn btn-danger" value="삭제" id="delectMajorBtn">-->
<input type="button" class="btn btn-success" value="등록" id="addMajorBtn" sec:authorize="hasRole('ROLE_SUB_ADMIN')">
</div>
</div>

View File

@ -1,17 +1,17 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="publicViewModalLabel">주요사건처리현황 열람</h5>
<h5 class="modal-title text-white" id="MajorViewModalLabel">주요사건처리현황 열람</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<input type="hidden" name="publicKeyKey" id="viewModalPublicKey" th:value="${major.majorKey}">
<input type="hidden" name="majorKey" id="viewModalMajorKey" th:value="${majorStatus.majorKey}">
<ul class="nav nav-tabs" id="userTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="boardTab" data-bs-toggle="tab" data-bs-target="#boardTabPanel" type="button" role="tab" aria-controls="boardTabPanel" aria-selected="true">본문</button>
</li>
<li class="nav-item" role="presentation" th:if="${#lists.size(major.fileList)>0}">
<button class="nav-link" id="fileTab" data-bs-toggle="tab" data-bs-target="#fileTabPanel" type="button" role="tab" aria-controls="fileTabPanel" aria-selected="false" th:text="${#strings.concat('첨부파일(', #lists.size(major.fileList), ')')}"></button>
<li class="nav-item" role="presentation" th:if="${#lists.size(majorStatus.fileList)>0}">
<button class="nav-link" id="fileTab" data-bs-toggle="tab" data-bs-target="#fileTabPanel" type="button" role="tab" aria-controls="fileTabPanel" aria-selected="false" th:text="${#strings.concat('첨부파일(', #lists.size(majorStatus.fileList), ')')}"></button>
</li>
</ul>
<div class="tab-content bg-white border border-top-0 p-2">
@ -19,23 +19,23 @@
<div class="row mb-1">
<div class="col-sm-9"></div>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">작성일시</label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start" th:text="${#temporals.format(major.wrtDt, 'yyyy-MM-dd HH:mm')}"></label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start" th:text="${#temporals.format(majorStatus.wrtDt, 'yyyy-MM-dd HH:mm')}"></label>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">제목</label>
<label class="col-sm-8 col-form-label col-form-label-sm text-start" th:text="${major.title}"></label>
<label class="col-sm-8 col-form-label col-form-label-sm text-start" th:text="${majorStatus.contentTitle}"></label>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">작성자</label>
<label class="col-sm-2 col-form-label col-form-label-sm text-start">
<th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq major.wrtOrgan}" th:text="${commonCode.itemValue}"></th:block>
<th:block th:if="${commonCode.itemCd eq majorStatus.wrtOrgan}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq major.wrtUserGrd}" th:text="${commonCode.itemValue}"></th:block>
<th:block th:if="${commonCode.itemCd eq majorStatus.wrtUserGrd}" th:text="${commonCode.itemValue}"></th:block>
</th:block>
<th:block th:text="${major.wrtUserNm}"></th:block>
<th:block th:text="${majorStatus.wrtUserNm}"></th:block>
</label>
<hr class="my-1">
<label for="content" class="col-sm-1 col-form-label col-form-label-sm text-center">내용</label>
<label for="contentInfo" class="col-sm-1 col-form-label col-form-label-sm text-center">내용</label>
<div class="col-sm-10 form-control-sm">
<div id="content" th:utext="${major.content}"></div>
<div id="contentInfo" th:utext="${majorStatus.contentInfo}"></div>
</div>
</div>
</div>
@ -50,16 +50,16 @@
</tr>
</thead>
<tbody>
<th:block th:if="${#lists.isEmpty(major.fileList)}">
<th:block th:if="${#lists.isEmpty(majorStatus.fileList)}">
<tr>
<td colspan="2">파일이 없습니다.</td>
</tr>
</th:block>
<th:block th:unless="${#lists.isEmpty(major.fileList)}">
<th:block th:each="file:${major.fileList}">
<th:block th:unless="${#lists.isEmpty(majorStatus.fileList)}">
<th:block th:each="file:${majorStatus.fileList}">
<tr class="fileInfoTr">
<td><a href="#" class="fileDownLink" data-board="publicFile"
th:data-parentkey="${file.publicKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td><a href="#" class="fileDownLink" data-board="majorFile"
th:data-parentkey="${file.majorKey}" th:data-fileseq="${file.fileSeq}" th:text="|${file.origNm}.${file.fileExtn}|"></a></td>
<td th:text="${file.fileSize}"></td>
</tr>
</th:block>
@ -70,31 +70,11 @@
</div>
</div>
<hr class="my-1">
<div class="row justify-content-start">
<div class="col-12 mx-3" id="commentFormHome">
<form action="#" method="post" id="commentForm">
<div class="row">
<div class="col-11">
<input type="hidden" name="publicKey" th:value="${major.majorKey}">
<input type="hidden" name="parentComment" id="parentComment">
<input type="text" class=" form-control form-control-sm" id="comment" name="comment" placeholder="댓글작성">
</div>
<div class="col-1 d-grid gap-0">
<div class="input-group">
<input type="button" class="btn btn-sm btn-primary" id="commentSaveBtn" value="작성">
<input type="button" class="btn btn-sm btn-warning" id="childFormRemoveBtn" value="취소" style="display: none">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="modal-footer bg-light">
<th:block th:if="${userSeq eq major.wrtUserSeq}"><!--작성자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editBtn">수정</button>
<th:block th:if="${userSeq eq majorStatus.wrtUserSeq}"><!--작성자일 경우 수정 허용-->
<button type="button" class="btn btn-warning" id="editBtn" th:data-majorkey="${majorStatus.majorKey}">수정</button>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>