중간저장.
parent
4432270e4f
commit
ef51c429ff
|
|
@ -1,9 +1,7 @@
|
|||
package com.dbnt.kcgfilemanager.controller;
|
||||
|
||||
import com.dbnt.kcgfilemanager.config.LogStatus;
|
||||
import com.dbnt.kcgfilemanager.model.Board;
|
||||
import com.dbnt.kcgfilemanager.model.FileInfo;
|
||||
import com.dbnt.kcgfilemanager.model.UserInfo;
|
||||
import com.dbnt.kcgfilemanager.model.*;
|
||||
import com.dbnt.kcgfilemanager.service.BoardService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
|
|
@ -73,6 +71,15 @@ public class BoardController {
|
|||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/fullSearchBoardContent")
|
||||
public ModelAndView fullSearchBoardContent(Board board,
|
||||
@RequestParam(value = "categorySeq", required = false) List<Integer> categorySeqList,
|
||||
@RequestParam(value = "tagName", required = false) List<String> tagNameList){
|
||||
ModelAndView mav = new ModelAndView("board/contentSearchResult");
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/selectBoardContent")
|
||||
public ModelAndView selectBoardContent(Board content, @AuthenticationPrincipal UserInfo loginUser){
|
||||
ModelAndView mav = new ModelAndView("board/contentDetail");
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ $(document).on('click', '#categoryDownBtn', function (){
|
|||
if(parentCheck(categorySeq)){
|
||||
childCheck(categorySeq);
|
||||
const categoryName = selectedCategory.attr("data-categoryname");
|
||||
const depth = selectedCategory.attr("data-depth");
|
||||
let categoryHtml = "<li class='nav-item mx-3 btn btn-secondary btn-sm selectedCategory'" +
|
||||
" id='selectedCategory"+categorySeq+"' data-categoryseq='"+categorySeq+"' data-categoryname='"+categoryName+"'>" +
|
||||
" id='selectedCategory"+categorySeq+"' data-categoryseq='"+categorySeq+"'" +
|
||||
" data-categoryname='"+categoryName+"' data-depth='"+depth+"'>" +
|
||||
"<input type='radio' class='categoryRadio' id='categoryRadio"+categorySeq+"' name='categoryRadio'>"+
|
||||
"<label for='categoryRadio"+categorySeq+"'> "+categoryName+"</label></li>";
|
||||
$("#selectedCategoryDiv").append(categoryHtml);
|
||||
|
|
@ -34,30 +36,28 @@ $(document).on('click', '#categoryUpBtn', function (){
|
|||
|
||||
$(document).on('click', '#categorySelectBtn', function (){
|
||||
const selectedCategory = $(".selectedCategory");
|
||||
let categorySeqs = "";
|
||||
let boardCategory = "";
|
||||
let categoryNames = "";
|
||||
selectedCategory.each(function (idx, el){
|
||||
categorySeqs += $(el).attr("data-categoryseq")+",";
|
||||
boardCategory += $(el).attr("data-categoryseq")+","+$(el).attr("data-depth")+"|";
|
||||
categoryNames += $(el).attr("data-categoryName")+", ";
|
||||
})
|
||||
$("#categorySeq").val(categorySeqs.slice(0, -1));
|
||||
$("#boardCategoryAry").val(boardCategory.slice(0, -1));
|
||||
$("#categoryName").val(categoryNames.slice(0, -2));
|
||||
$("#categorySelectModal").find(".btn-close").click();
|
||||
})
|
||||
|
||||
$(document).on('click', '#searchBtn', function (){
|
||||
|
||||
const param = getSearchParam();
|
||||
$.ajax({
|
||||
url: '/board/boardContentSearch',
|
||||
data: {contentSeq: contentSeq},
|
||||
url: '/board/fullSearchBoardContent',
|
||||
data: param,
|
||||
type: 'GET',
|
||||
processData: false,
|
||||
contentType: false,
|
||||
dataType:"html",
|
||||
success: function(html){
|
||||
$("#contentDiv").empty().append(html)
|
||||
if($("#contentStatus").val() !== "D"){
|
||||
const viewCntTd = $(".contentCheckBox:checked").parents("tr").find(".viewCntTd");
|
||||
viewCntTd.text(Number(viewCntTd.text())+1);
|
||||
}
|
||||
$("#searchResultDiv").empty().append(html)
|
||||
},
|
||||
error:function(){
|
||||
|
||||
|
|
@ -65,6 +65,48 @@ $(document).on('click', '#searchBtn', function (){
|
|||
});
|
||||
})
|
||||
|
||||
function getSearchParam(){
|
||||
const param = {board: {}};
|
||||
let boardCategoryAry = $("#boardCategoryAry").val();
|
||||
if(boardCategoryAry){
|
||||
boardCategoryAry = boardCategoryAry.split('|');
|
||||
param.boardCategoryList = [];
|
||||
boardCategoryAry.forEach((value) => {
|
||||
const boardCategory = value.split(',');
|
||||
param.boardCategoryList.push({categorySeq: boardCategory[0], depth: boardCategory[1]});
|
||||
})
|
||||
}
|
||||
const title = $("#title").val();
|
||||
if(title){
|
||||
param.board.title = title;
|
||||
}
|
||||
const createName = $("#createName").val();
|
||||
if(createName){
|
||||
param.board.createName = createName;
|
||||
}
|
||||
let tagNameAry = $("#tagName").val();
|
||||
if(tagNameAry){
|
||||
tagNameAry = tagNameAry.split(',')
|
||||
param.hasTagList = [];
|
||||
tagNameAry.forEach((value => {
|
||||
param.hasTagList.push({tagName: value})
|
||||
}))
|
||||
}
|
||||
const startDate = $("#startDate").val();
|
||||
if(startDate){
|
||||
param.board.startDate = startDate;
|
||||
}
|
||||
const endDate = $("#endDate").val();
|
||||
if(endDate){
|
||||
param.board.endDate = endDate;
|
||||
}
|
||||
const originalName = $("#originalName").val();
|
||||
if(originalName){
|
||||
param.board.searchFileName = originalName;
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
function parentCheck(categorySeq){
|
||||
const radio = $("#categoryRadio"+categorySeq);
|
||||
if(radio.length>0){
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@
|
|||
<div class="card-body row">
|
||||
<div class="col-10">
|
||||
<div class="row mb-1">
|
||||
<label for="categorySeq" class="col-sm-2 col-form-label">분류</label>
|
||||
<label for="categoryName" class="col-sm-2 col-form-label">분류</label>
|
||||
<div class="col-sm-8 pe-0">
|
||||
<input type="hidden" id="categorySeq">
|
||||
<input type="hidden" id="boardCategoryAry">
|
||||
<input type="text" class="form-control form-control-sm" id="categoryName" placeholder="오른쪽 분류 선택 버튼으로 등록" readonly>
|
||||
</div>
|
||||
<div class="col-sm-2 px-0">
|
||||
|
|
@ -43,13 +43,13 @@
|
|||
<div class="row mb-1">
|
||||
<label for="title" class="col-sm-2 col-form-label">해시태그</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control form-control-sm" id="tagName" placeholder="# 없이 태그 입력">
|
||||
<input type="text" class="form-control form-control-sm" id="tagName" placeholder="# 없이 ,로 구분하여 태그 입력">
|
||||
</div>
|
||||
<label for="startDate" class="col-sm-2 col-form-label">작성일</label>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-auto input-group w-auto input-daterange" id="dateSelectorDiv">
|
||||
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off">
|
||||
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off">
|
||||
<input type="text" class="form-control form-control-sm" id="startDate" placeholder="시작일" autocomplete="off">
|
||||
<input type="text" class="form-control form-control-sm" id="endDate" placeholder="종료일" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-outline-info" href="/board/contentSearch"><i class="bi bi-search"></i> 통합 검색</a>
|
||||
<a class="btn btn-primary" href="/board/contentSearch"><i class="bi bi-search"></i> 통합 검색</a>
|
||||
</div>
|
||||
<div class="d-grid gap-2 pt-1">
|
||||
<a class="btn btn-success" href="/board/contentWrite"><i class="bi bi-file-earmark-plus "></i> 자료 등록</a>
|
||||
|
|
|
|||
Loading…
Reference in New Issue