외사정보보고 작업중.

강석 최 2022-10-24 18:18:53 +09:00
parent 19bbfaa5fd
commit 26c2c0374f
16 changed files with 307 additions and 83 deletions

View File

@ -1,5 +1,6 @@
package com.dbnt.faisp.config; package com.dbnt.faisp.config;
import com.dbnt.faisp.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.menuMgt.model.MenuMgt; import com.dbnt.faisp.menuMgt.model.MenuMgt;
import com.dbnt.faisp.menuMgt.service.MenuMgtService; import com.dbnt.faisp.menuMgt.service.MenuMgtService;
import com.dbnt.faisp.userInfo.model.UserInfo; import com.dbnt.faisp.userInfo.model.UserInfo;
@ -19,6 +20,7 @@ public class ModalController {
private final MenuMgtService menuMgtService; private final MenuMgtService menuMgtService;
private final UserInfoService userInfoService; private final UserInfoService userInfoService;
private final CodeMgtService codeMgtService;
@GetMapping("/menuModal") @GetMapping("/menuModal")
public ModelAndView menuModalPage(@AuthenticationPrincipal UserInfo loginUser, MenuMgt menuMgt){ public ModelAndView menuModalPage(@AuthenticationPrincipal UserInfo loginUser, MenuMgt menuMgt){
@ -39,6 +41,8 @@ public class ModalController {
if(userInfo.getUserStatus() == null || userInfo.getUserStatus().equals("")) { if(userInfo.getUserStatus() == null || userInfo.getUserStatus().equals("")) {
userInfo.setUserStatus("USC003"); userInfo.setUserStatus("USC003");
} }
mav.addObject("OgList", codeMgtService.selectCodeMgtList("OG"));
mav.addObject("OfcList", codeMgtService.selectCodeMgtList("OFC"));
mav.addObject("userInfoList", userInfoService.selectUserInfoList(userInfo)); mav.addObject("userInfoList", userInfoService.selectUserInfoList(userInfo));
userInfo.setContentCnt(userInfoService.selectUserInfoListCnt(userInfo)); userInfo.setContentCnt(userInfoService.selectUserInfoListCnt(userInfo));
userInfo.setPaginationInfo(); userInfo.setPaginationInfo();

View File

@ -3,6 +3,7 @@ package com.dbnt.faisp.faRpt;
import com.dbnt.faisp.authMgt.service.AuthMgtService; import com.dbnt.faisp.authMgt.service.AuthMgtService;
import com.dbnt.faisp.codeMgt.service.CodeMgtService; import com.dbnt.faisp.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.faRpt.model.FaRptBoard; import com.dbnt.faisp.faRpt.model.FaRptBoard;
import com.dbnt.faisp.faRpt.model.FaRptReadUser;
import com.dbnt.faisp.faRpt.service.FaRptService; import com.dbnt.faisp.faRpt.service.FaRptService;
import com.dbnt.faisp.fpiMgt.affairPlan.model.PlanBoard; import com.dbnt.faisp.fpiMgt.affairPlan.model.PlanBoard;
import com.dbnt.faisp.userInfo.model.UserInfo; import com.dbnt.faisp.userInfo.model.UserInfo;
@ -27,10 +28,10 @@ public class FaRptController {
public ModelAndView faRptBoard(@AuthenticationPrincipal UserInfo loginUser, FaRptBoard faRptBoard){ public ModelAndView faRptBoard(@AuthenticationPrincipal UserInfo loginUser, FaRptBoard faRptBoard){
ModelAndView mav; ModelAndView mav;
if(faRptBoard.getDashboardFlag()){ if(faRptBoard.getDashboardFlag()){
mav = new ModelAndView("/faRpt/faRptDashboard"); mav = new ModelAndView("faRpt/faRptDashboard");
faRptBoard.setRowCnt(5); faRptBoard.setRowCnt(5);
}else{ }else{
mav = new ModelAndView("/faRpt/faRptBoard"); mav = new ModelAndView("faRpt/faRptBoard");
} }
if(faRptBoard.getActiveTab()==null){ if(faRptBoard.getActiveTab()==null){
faRptBoard.setActiveTab("send"); faRptBoard.setActiveTab("send");
@ -97,4 +98,12 @@ public class FaRptController {
faRptBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles")); faRptBoard.setMultipartFileList(request.getMultiFileMap().get("uploadFiles"));
return faRptService.saveFaRptBoard(faRptBoard, deleteFileSeq); return faRptService.saveFaRptBoard(faRptBoard, deleteFileSeq);
} }
@PostMapping("/selectedUserTable")
@ResponseBody
public ModelAndView selectedUserTable(@RequestBody List<FaRptReadUser> userList){
ModelAndView mav = new ModelAndView("faRpt/readUserRow");
mav.addObject("userList", userList);
return mav;
}
} }

View File

@ -7,4 +7,6 @@ import java.util.List;
public interface FaRptReadUserRepository extends JpaRepository<FaRptReadUser, FaRptReadUser.FaRptReadUserId> { public interface FaRptReadUserRepository extends JpaRepository<FaRptReadUser, FaRptReadUser.FaRptReadUserId> {
List<FaRptReadUser> findByFaRptKey(Integer faRptKey); List<FaRptReadUser> findByFaRptKey(Integer faRptKey);
void deleteByFaRptKey(Integer faRptKey);
} }

View File

@ -4,6 +4,7 @@ import com.dbnt.faisp.config.BaseService;
import com.dbnt.faisp.config.FileInfo; import com.dbnt.faisp.config.FileInfo;
import com.dbnt.faisp.faRpt.mapper.FaRptMapper; import com.dbnt.faisp.faRpt.mapper.FaRptMapper;
import com.dbnt.faisp.faRpt.model.FaRptBoard; import com.dbnt.faisp.faRpt.model.FaRptBoard;
import com.dbnt.faisp.faRpt.model.FaRptFile;
import com.dbnt.faisp.faRpt.model.FaRptReadUser; import com.dbnt.faisp.faRpt.model.FaRptReadUser;
import com.dbnt.faisp.faRpt.repository.FaRptBoardRepository; import com.dbnt.faisp.faRpt.repository.FaRptBoardRepository;
import com.dbnt.faisp.faRpt.repository.FaRptFileRepository; import com.dbnt.faisp.faRpt.repository.FaRptFileRepository;
@ -38,8 +39,19 @@ public class FaRptService extends BaseService {
return faRptMapper.selectFaRptCnt(faRptBoard); return faRptMapper.selectFaRptCnt(faRptBoard);
} }
@Transactional
public Integer saveFaRptBoard(FaRptBoard faRptBoard, List<Integer> deleteFileSeq) { public Integer saveFaRptBoard(FaRptBoard faRptBoard, List<Integer> deleteFileSeq) {
return 0; Integer faRptKey = faRptBoardRepository.save(faRptBoard).getFaRptKey();
if(deleteFileSeq!=null && deleteFileSeq.size()>0){
deleteFaRptFile(faRptKey, deleteFileSeq);
}
if(faRptBoard.getMultipartFileList() != null){
saveUploadFiles(faRptKey, faRptBoard.getMultipartFileList());
}
if(faRptBoard.getReadUserList() != null){
saveFaRptReadUser(faRptKey, faRptBoard.getReadUserList());
}
return faRptKey;
} }
public FaRptBoard selectFaRptBoard(Integer faRptKey) { public FaRptBoard selectFaRptBoard(Integer faRptKey) {
@ -48,4 +60,46 @@ public class FaRptService extends BaseService {
faRptBoard.setReadUserList(faRptReadUserRepository.findByFaRptKey(faRptKey)); faRptBoard.setReadUserList(faRptReadUserRepository.findByFaRptKey(faRptKey));
return faRptBoard; return faRptBoard;
} }
private void saveFaRptReadUser(Integer faRptKey, List<FaRptReadUser> readUserList) {
faRptReadUserRepository.deleteByFaRptKey(faRptKey);
for(FaRptReadUser readUser: readUserList){
readUser.setFaRptKey(faRptKey);
}
faRptReadUserRepository.saveAll(readUserList);
}
private void saveUploadFiles(Integer faRptKey, List<MultipartFile> multipartFileList) {
FaRptFile lastFile = faRptFileRepository.findTopByFaRptKeyOrderByFileSeq(faRptKey).orElse(null);
int fileSeq = lastFile==null?1:(lastFile.getFileSeq()+1);
for(MultipartFile file: multipartFileList){
String saveName = UUID.randomUUID().toString();
String path = locationPath+File.separator+"faRpt"+File.separator;
saveFile(file, new File(path+File.separator+saveName));
String originalFilename = file.getOriginalFilename();
int extnIdx = originalFilename.lastIndexOf(".");
FaRptFile fileInfo = new FaRptFile();
fileInfo.setFaRptKey(faRptKey);
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);
faRptFileRepository.save(fileInfo);
}
}
private void deleteFaRptFile(Integer faRptKey, List<Integer> deleteFileSeq) {
List<FaRptFile> fileList = faRptFileRepository.findByFaRptKey(faRptKey);
for(FaRptFile file: fileList){
if(deleteFileSeq.contains(file.getFileSeq())){
deleteStoredFile(new File(file.getSavePath(), file.getConvNm()));
faRptFileRepository.delete(file);
}
}
}
} }

View File

@ -9,6 +9,11 @@
<if test='wrtUserSeq != null and wrtUserSeq != ""'> <if test='wrtUserSeq != null and wrtUserSeq != ""'>
and a.wrt_user_seq = #{wrtUserSeq} and a.wrt_user_seq = #{wrtUserSeq}
</if> </if>
<if test='receiveUserSeq != null and receiveUserSeq != ""'>
and a.fa_rpt_key = (select fa_rpt_key
from fa_rpt_read_user
where user_seq = #{receiveUserSeq})
</if>
<if test='wrtUserNm != null and wrtUserNm != ""'> <if test='wrtUserNm != null and wrtUserNm != ""'>
and a.wrt_user_nm like '%'||#{wrtUserNm}||'%' and a.wrt_user_nm like '%'||#{wrtUserNm}||'%'
</if> </if>

View File

@ -37,7 +37,7 @@ function searchModalSubmit(pageIndex){
contentType: false, contentType: false,
dataType:"html", dataType:"html",
success: function(html){ success: function(html){
$("#modalBody").empty().append(html) $("#subModalBody").empty().append(html)
if(selectedList !== undefined && selectedList.length>0){ if(selectedList !== undefined && selectedList.length>0){
setSelectedChkBox(); setSelectedChkBox();
} }

View File

@ -21,7 +21,7 @@ $(document).on('click', '#addFaRptBtn', function (){
}) })
$(document).on('click', '#editFaRptBtn', function (){ $(document).on('click', '#editFaRptBtn', function (){
$("#faRptViewModal").modal('hide'); $("#faRptViewModal").modal('hide');
getFaRptEditModal(Number($("#faRptViewBody").find("[name='faRptKey']").val())); getFaRptEditModal(Number($(this).attr("data-farptkey")));
}) })
$(document).on('click', '#addReadUserBtn', function (){ $(document).on('click', '#addReadUserBtn', function (){

View File

@ -0,0 +1,49 @@
$(document).on('click', '.menuTr', function (){
const checkBox = $(this).find(".menuCheckBox")[0]
checkBox.checked = !checkBox.checked;
if(checkBox.checked){
selectedList.push({
menuKey: Number(checkBox.value),
orderNum: selectedList.length+1,
cat1Cd: $(this).find(".cat1Cd").val(),
cat2Cd: $(this).find(".cat2Cd").val(),
cat3Cd: $(this).find(".cat3Cd").val(),
menuUrl: $(this).find(".menuUrl").val()
});
}else{
const tempList = [];
$.each(selectedList, function (idx, menu){
if(menu.menuKey !== Number(checkBox.value)){
menu.orderNum = idx+1;
tempList.push(menu);
}
})
selectedList = tempList;
}
})
$(document).on('click', '#getMenuBtn', function (){
$.ajax({
type : 'POST',
url : "/myInfo/selectedMenuTable",
data : JSON.stringify(selectedList),
contentType: 'application/json',
dataType:"html",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(html) {
$("#dashboardConfigTbody").empty().append($(html)[1].children[0].children);
$("#menuModal").modal("hide");
},
error : function(xhr, status) {
}
})
})
function setSelectedChkBox(){
$.each(selectedList, function (idx, item){
$("[value="+item.menuKey+"]").prop("checked", true);
})
}

View File

@ -0,0 +1,49 @@
$(document).on('click', '.userInfoTr', function (){
const checkBox = $(this).find(".userInfoCheckBox")[0]
checkBox.checked = !checkBox.checked;
const userSeq = $(this).find(".userSeq").val();
if(checkBox.checked){
selectedList.push({
userSeq: userSeq,
ogCd: $(this).find(".ogCd").val(),
ofcCd: $(this).find(".ofcCd").val(),
titleCd: $(this).find(".titleCd").val(),
userNm: $(this).find(".userNm").val()
})
}else{
const tempList = [];
$.each(selectedList, function (idx, user){
if(user.userSeq !== userSeq){
tempList.push(user);
}
})
selectedList = tempList;
}
})
$(document).on('click', '#getMenuBtn', function (){
$.ajax({
type : 'POST',
url : "/faRpt/selectedUserTable",
data : JSON.stringify(selectedList),
contentType: 'application/json',
dataType:"html",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(html) {
$("#readUserRow").empty().append(html);
$("#userModal").modal("hide");
},
error : function(xhr, status) {
}
})
})
function setSelectedChkBox(){
$.each(selectedList, function (idx, item){
$(".userInfoCheckBox[value="+item.userSeq+"]").prop("checked", true);
})
}

View File

@ -1,4 +1,5 @@
let selectedList = []; let selectedList = [];
$(function (){ $(function (){
$.ajax({ $.ajax({
type : 'GET', type : 'GET',
@ -40,50 +41,6 @@ $(document).on('click', '#configDeleteBtn', function (){
orderNumSort(); orderNumSort();
}) })
$(document).on('click', '.menuTr', function (){
const checkBox = $(this).find(".menuCheckBox")[0]
checkBox.checked = !checkBox.checked;
if(checkBox.checked){
selectedList.push({
menuKey: Number(checkBox.value),
orderNum: selectedList.length+1,
cat1Cd: $(this).find(".cat1Cd").val(),
cat2Cd: $(this).find(".cat2Cd").val(),
cat3Cd: $(this).find(".cat3Cd").val(),
menuUrl: $(this).find(".menuUrl").val()
});
}else{
const tempList = [];
$.each(selectedList, function (idx, menu){
if(menu.menuKey !== Number(checkBox.value)){
menu.orderNum = idx+1;
tempList.push(menu);
}
})
selectedList = tempList;
}
})
$(document).on('click', '#getMenuBtn', function (){
$.ajax({
type : 'POST',
url : "/myInfo/selectedMenuTable",
data : JSON.stringify(selectedList),
contentType: 'application/json',
dataType:"html",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(html) {
$("#dashboardConfigTbody").empty().append($(html)[1].children[0].children);
$("#menuModal").modal("hide");
},
error : function(xhr, status) {
}
})
})
$(document).on('click', '#savePasswordBtn', function (){ $(document).on('click', '#savePasswordBtn', function (){
if(passwordCheck()){ if(passwordCheck()){
const formData = new FormData($("#modifyPasswordForm")[0]); const formData = new FormData($("#modifyPasswordForm")[0]);
@ -161,11 +118,6 @@ function orderNumSort(){
return 0; return 0;
}) })
} }
function setSelectedChkBox(){
$.each(selectedList, function (idx, item){
$("[value="+item.menuKey+"]").prop("checked", true);
})
}
function passwordCheck(){ function passwordCheck(){
let returnFlag = true; let returnFlag = true;

View File

@ -3,7 +3,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<form method="get" action="#" id="modalSearchForm"> <form method="get" action="#" id="modalSearchForm">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <input type="hidden" name="pageIndex" id="modalPageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1"> <div class="row justify-content-between pe-3 py-1">
<div class="col-auto"> <div class="col-auto">
<select class="form-select" name="rowCnt" id="rowCnt"> <select class="form-select" name="rowCnt" id="rowCnt">

View File

@ -1,25 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<form method="get" action="#" id="modalSearchForm"> <form method="get" action="#" id="modalSearchForm">
<input type="hidden" name="userStatus" id="userStatus" th:value="${searchParams.userStatus}"> <input type="hidden" name="userStatus" id="userStatus" th:value="${searchParams.userStatus}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <input type="hidden" name="pageIndex" id="modalPageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between pe-3 py-1"> <input type="hidden" name="rowCnt" value="10">
<div class="col-auto"> <div class="row justify-content-end pe-3 py-1">
<select class="form-select" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto"> <div class="col-auto">
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="ogCd"> <select class="form-select form-select-sm" name="ogCd">
<option value="">관서 선택</option> <option value="">관서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="commonCode:${OgList}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ogCd==commonCode.itemCd}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ogCd==commonCode.itemCd}"></option>
</th:block> </th:block>
</select> </select>
@ -27,7 +20,7 @@
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="ofcCd"> <select class="form-select form-select-sm" name="ofcCd">
<option value="">부서 선택</option> <option value="">부서 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${OfcList}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ofcCd==commonCode.itemCd}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.ofcCd==commonCode.itemCd}"></option>
</th:block> </th:block>
</select> </select>
@ -38,7 +31,7 @@
<div class="col-auto"> <div class="col-auto">
<input type="text" class="form-control form-control-sm" name="userId" placeholder="사용자 아이디" th:value="${searchParams.userId}"> <input type="text" class="form-control form-control-sm" name="userId" placeholder="사용자 아이디" th:value="${searchParams.userId}">
</div> </div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색"> <input type="button" class="btn btn-sm btn-primary col-auto" id="searchModalBtn" value="검색">
</div> </div>
</div> </div>
</div> </div>
@ -51,7 +44,7 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th> <input type="checkbox" id="chk-all" class="userInfoCheckBox"></th> <th><input type="checkbox" class="allChk"></th>
<th>소속</th> <th>소속</th>
<th>부서</th> <th>부서</th>
<th>계급</th> <th>계급</th>
@ -62,9 +55,13 @@
</thead> </thead>
<tbody> <tbody>
<tr class="userInfoTr" th:each="userInfo:${userInfoList}"> <tr class="userInfoTr" th:each="userInfo:${userInfoList}">
<input type="hidden" name="userSeq" class="userSeq" th:value="${userInfo.userSeq}"> <input type="hidden" class="userSeq" th:value="${userInfo.userSeq}">
<input type="hidden" class="ogCd" th:value="${userInfo.ogCd}">
<input type="hidden" class="ofcCd" th:value="${userInfo.ofcCd}">
<input type="hidden" class="titleCd" th:value="${userInfo.titleCd}">
<input type="hidden" class="userNm" th:value="${userInfo.userNm}">
<td> <td>
<input type="checkbox" id="userChk" name="userChk" class="userInfoCheckBox" th:value="${userInfo.userSeq}"> <input type="checkbox" name="userChk" class="userInfoCheckBox" th:value="${userInfo.userSeq}">
</td> </td>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd == userInfo.ogCd}"> <th:block th:if="${commonCode.itemCd == userInfo.ogCd}">
@ -89,19 +86,19 @@
<nav aria-label="Page navigation"> <nav aria-label="Page navigation">
<ul class="pagination"> <ul class="pagination">
<th:block th:if="${searchParams.pageIndex>3}"> <th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}"> <li class="page-item modalPage" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous"> <a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span> <span aria-hidden="true">&laquo;</span>
</a> </a>
</li> </li>
</th:block> </th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}"> <th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}"> <li class="page-item modalPage" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a> <a class="page-link" href="#" th:text="${num}"></a>
</li> </li>
</th:block> </th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}"> <th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}"> <li class="page-item modalPage" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next"> <a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span> <span aria-hidden="true">&raquo;</span>
</a> </a>

View File

@ -4,6 +4,7 @@
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script> <script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
@ -159,14 +160,14 @@
</div> </div>
</div> </div>
<div class="modal fade" id="userModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true"> <div class="modal fade" id="userModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="userModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable"> <div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="menuModalLabel">수신자 검색</h5> <h5 class="modal-title" id="menuModalLabel">수신자 검색</h5>
<input type="hidden" id="modalUrl" value="/modal/userModal"> <input type="hidden" id="modalUrl" value="/modal/userModal">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body" id="modalBody"> <div class="modal-body" id="subModalBody">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<form method="get" action="#" id="modalSearchForm"> <form method="get" action="#" id="modalSearchForm">

View File

@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="faRptViewModalLabel">외사정보보고 열람</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="faRptViewBody">
<div class="row">
<div class="col-8">
<div class="mb-3 row">
<label for="wrtUserNm" class="col-sm-2 col-form-label col-form-label-sm text-center">작성자</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="wrtUserNm" name="wrtUserNm" th:value="${faRpt.wrtUserNm}" readonly>
</div>
<label for="wrtDt" class="col-sm-2 col-form-label col-form-label-sm text-center">작성일시</label>
<div class="col-sm-4">
<input type="text" class="form-control form-control-sm" id="wrtDt" name="wrtDt" th:value="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}" readonly>
</div>
</div>
<div class="mb-3 row">
<label for="faRptType" class="col-sm-2 col-form-label col-form-label-sm text-center">분류</label>
<div class="col-sm-4">
<select class="form-select form-select-sm" id="faRptType" name="faRptType">
<option value="">선택해주세요.</option>
<th:block th:each="frCategory:${frCategoryList}">
<option th:value="${frCategory.itemCd}" th:text="${frCategory.itemValue}" th:selected="${frCategory.itemCd eq faRpt.faRptType}"></option>
</th:block>
</select>
</div>
</div>
<div class="mb-3 row">
<label for="title" class="col-sm-2 col-form-label col-form-label-sm text-center">제목</label>
<div class="col-sm-10">
<input type="text" class="form-control form-control-sm" id="title" name="title" th:value="${faRpt.title}">
</div>
</div>
<div class="mb-3 row justify-content-center">
<label for="content" class="col-sm-2 col-form-label col-form-label-sm text-center">내용</label>
<div class="col-sm-10">
<textarea type='text' id="content" name='content' th:utext="${faRpt.content}"></textarea>
</div>
</div>
<div class="mb-3 row">
<label for="hashTags" class="col-sm-2 col-form-label col-form-label-sm text-center">해시태그</label>
<div class="col-sm-10">
<input type="text" class="form-control form-control-sm" id="hashTags" name="hashTags"
placeholder="띄어쓰기로 각 태그를 구분합니다. 한 태그 내에서는 띄어쓰기 없이 입력해주세요. ex)태그1 태그2">
</div>
</div>
<div class="row mb-3">
<label for="fileInputer" class="col-sm-2 col-form-label col-form-label-sm text-center">업로드 자료</label>
<div class="col-sm-10" style="min-height: 70px;">
<div class="w-100 h-100 border border-info rounded text-center" id="uploadDiv">
<th:block th:if="${#arrays.isEmpty(faRpt.fileList)}">
<br>파일을 업로드 해주세요.
</th:block>
<th:block th:unless="${#arrays.isEmpty(faRpt.fileList)}">
<div class='row-col-6' th:each="faRptFile:${faRpt.fileList}">
<span th:data-fileseq="${faRptFile.fileSeq}" th:text="|${faRptFile.origNm}.${faRptFile.fileExtn} ${faRptFile.fileSize}|"></span>
<a href='#' class='uploadedFileDelete text-danger text-decoration-none'>삭제</a>
</div>
</th:block>
</div>
</div>
<input type="file" class="d-none" id="fileInputer" multiple>
</div>
</div>
<div class="col-4">
<div class="row">
<div class="col-12 pb-2">
<div class="row justify-content-between">
<div class="col-auto">■ 수신자</div>
<div class="col-auto"><button type="button" class="btn btn-sm btn-info" id="addReadUserBtn">추가</button></div>
</div>
</div>
<div class="col-1">no</div>
<div class="col-9">수신자</div>
<div class="col-2">삭제</div>
</div>
<hr class="my-1">
<div class="row">
<div class="col-12" id="readUserRow">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<th:block th:if="${userSeq eq faRpt.wrtUserSeq}">
<button type="button" class="btn btn-warning" id="editFaRptBtn" th:data-farptkey="${faRpt.faRptKey}">수정</button>
</th:block>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
</div>

View File

@ -1,8 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="row my-1 readUserRow" th:id="|row${idx}|"> <th:block th:each="readUser, idx:${userList}">
<input type="hidden" class="userSeq" th:name="${#strings.concat('readUserList[', idx,'].userSeq')}" th:value="${readUser.userSeq}"> <div class="row my-1 readUserRow" th:id="|row${idx.index}|">
<div class="col-1 rowSeq" th:text="${idx+1}"></div> <input type="hidden" class="userSeq" th:name="${#strings.concat('readUserList[', idx.index,'].userSeq')}" th:value="${readUser.userSeq}">
<input type="hidden" class="ogCd" th:name="${#strings.concat('readUserList[', idx.index,'].ogCd')}" th:value="${readUser.ogCd}">
<input type="hidden" class="ofcCd" th:name="${#strings.concat('readUserList[', idx.index,'].ofcCd')}" th:value="${readUser.ofcCd}">
<input type="hidden" class="titleCd" th:name="${#strings.concat('readUserList[', idx.index,'].titleCd')}" th:value="${readUser.titleCd}">
<input type="hidden" class="userNm" th:name="${#strings.concat('readUserList[', idx.index,'].userNm')}" th:value="${readUser.userNm}">
<div class="col-1 rowSeq" th:text="${idx.index+1}"></div>
<div class="col-9"> <div class="col-9">
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <th:block th:each="commonCode:${session.commonCode.get('OG')}">
<th:block th:if="${commonCode.itemCd eq readUser.ogCd}" th:text="${commonCode.itemValue}"></th:block> <th:block th:if="${commonCode.itemCd eq readUser.ogCd}" th:text="${commonCode.itemValue}"></th:block>
@ -10,11 +15,14 @@
<th:block th:each="commonCode:${session.commonCode.get('OFC')}"> <th:block th:each="commonCode:${session.commonCode.get('OFC')}">
<th:block th:if="${commonCode.itemCd eq readUser.ofcCd}" th:text="${commonCode.itemValue}"></th:block> <th:block th:if="${commonCode.itemCd eq readUser.ofcCd}" th:text="${commonCode.itemValue}"></th:block>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCode.get('JT')}"> <!--<th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq readUser.titleCd}" th:text="|${commonCode.itemValue} ${readUser.userNm}|"></th:block> <th:block th:if="${commonCode.itemCd eq readUser.titleCd}" th:text="|${commonCode.itemValue} ${readUser.userNm}|"></th:block>
</th:block> </th:block>-->
<th:block th:text="${readUser.userNm}"></th:block>
</div> </div>
<div class="col-2"> <div class="col-2">
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button> <button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>
</div> </div>
</div> </div>
</th:block>
</html>

View File

@ -12,6 +12,7 @@
</th:block> </th:block>
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/user/info.js}"></script> <script type="text/javascript" th:src="@{/js/user/info.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/menuModal.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
@ -138,7 +139,7 @@
<input type="hidden" id="modalUrl" value="/modal/menuModal"> <input type="hidden" id="modalUrl" value="/modal/menuModal">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body" id="modalBody"> <div class="modal-body" id="subModalBody">
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<form method="get" action="#" id="modalSearchForm"> <form method="get" action="#" id="modalSearchForm">