견문목록에서 첨부파일 다운로드 방식 변경.
parent
292f639b3d
commit
4749d80839
|
|
@ -203,7 +203,14 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
|
|||
mav.addObject("affairRating", affairService.getAffairRating(affairBoard, affairBoard.getWrtOrgan()));
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/fileListDiv")
|
||||
public ModelAndView fileListDiv(AffairBoard affairBoard){
|
||||
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/affair/fileListDiv");
|
||||
List<Integer> affairKeyList = new ArrayList<>();
|
||||
affairKeyList.add(affairBoard.getAffairKey());
|
||||
mav.addObject("fileList", affairService.selectAffairFileList(affairKeyList));
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/deleteAffair")
|
||||
@ResponseBody
|
||||
|
|
|
|||
|
|
@ -323,7 +323,8 @@ public class AffairService extends BaseService { // 견문보고
|
|||
affair.setAffairType2(Utils.searchCodeValue(affair.getAffairType2(), codeMap.get("DC02")));
|
||||
affair.setAffairType3(Utils.searchCodeValue(affair.getAffairType3(), codeMap.get("DC03")));
|
||||
affair.setAffairType4(Utils.searchCodeValue(affair.getAffairType4(), codeMap.get("DC04")));
|
||||
AffairRating rating = getAffairRating(affair, affair.getWrtOrgan());
|
||||
//AffairRating rating = getAffairRating(affair, affair.getWrtOrgan());
|
||||
AffairRating rating = affair.getRateList().get(0);
|
||||
if(Utils.isEmpty(rating.getSectionNm())){
|
||||
affair.setSectionNm(rating.getHeadNm());
|
||||
affair.setHeadNm("전결");
|
||||
|
|
@ -364,6 +365,7 @@ public class AffairService extends BaseService { // 견문보고
|
|||
}
|
||||
return affair;
|
||||
}
|
||||
|
||||
public AffairRating getAffairRating(AffairBoard affairBoard, String ogCd){
|
||||
AffairRating affairRating = null;
|
||||
for(AffairRating rating: affairBoard.getRateList()){
|
||||
|
|
|
|||
|
|
@ -29,14 +29,32 @@ $(document).on('click', '.affairTr', function (event){
|
|||
$(".trChkBox").prop("checked", false);
|
||||
chkBox[0].checked = true;
|
||||
}
|
||||
|
||||
if(target.className === "fileTd"
|
||||
|| $(target).parents(".fileTd").length>0){
|
||||
$("#fileDownBtn").click();
|
||||
}else{
|
||||
getAffairViewModal(Number($(this).find(".affairKey").val()));
|
||||
}
|
||||
})
|
||||
|
||||
$(document).on('mouseover', '.fileTd', function (event){
|
||||
const fileListDiv = $("#fileListDiv");
|
||||
const rect = event.target.getBoundingClientRect()
|
||||
fileListDiv.attr('style', 'top: '+(rect.top-65)+'px; '+'left: '+(rect.left-300)+'px');
|
||||
const affairKey = $(this).parents(".affairTr").find(".affairKey").val();
|
||||
$.ajax({
|
||||
url: '/affair/fileListDiv',
|
||||
data: {affairKey: affairKey},
|
||||
type: 'GET',
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
fileListDiv.empty().append(html)
|
||||
fileListDiv.show();
|
||||
},
|
||||
error:function(e){
|
||||
ajaxErrorAction(e);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
$(document).on('mouseleave', '#fileListDiv', function (){
|
||||
$(this).empty().hide();
|
||||
})
|
||||
|
||||
$(document).on('click', '#addAffairBtn', function (){
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ $(document).on('click', '#affairPrintBtn', function (){
|
|||
form.action = url;
|
||||
form.crfName.value = "affairBoard";
|
||||
data.wrtDt = data.reportDt;
|
||||
debugger
|
||||
form.json.value = JSON.stringify(data);
|
||||
form.method = "post";
|
||||
form.submit();
|
||||
|
|
|
|||
|
|
@ -289,6 +289,7 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="position-absolute bg-white border p-2" id="fileListDiv" style="display: none"></div>
|
||||
<div class="row justify-content-between">
|
||||
<div class="col-auto">
|
||||
<button type="button" class="btn btn-sm btn-info" id="fileDownBtn">첨부파일 다운로드</button>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
||||
<th:block th:each="file:${fileList}">
|
||||
<div class="fileInfoTr">
|
||||
<a href="#" class="fileDownLink" data-board="affair"
|
||||
th:data-parentkey="${file.affairKey}" th:data-fileseq="${file.fileSeq}"
|
||||
th:text="${#strings.concat(file.origNm, '.', file.fileExtn, '(', file.fileSize, ')')}"></a>
|
||||
</div>
|
||||
</th:block>
|
||||
Loading…
Reference in New Issue