Update main.jsp

This commit is contained in:
sungsuhub
2024-01-24 11:17:30 +09:00
committed by GitHub
parent bfb2e8fa14
commit c84ebae56c

View File

@@ -1,106 +1,151 @@
<%@ page contentType="text/html; charset=UTF-8"%> <%@ page contentType="text/html; charset=UTF-8" %>3
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Insert title here</title> <title>Insert title here</title>
</head> </head>
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-5"> <div class="col-md-6 ">
<div>첫 번째 공간</div> <div><img alt="Default Image" src="/resources/static/img/mainpage/2.png" width="500px" /></div>
</div> </div>
<div class="col-md-5"> <div class="col-md-5">
<div class="text-center"><h2><b>No.1 WMS 달력</b></h2></div> <div class="text-center"><h2><b>No.1 WMS 달력</b></h2></div>
<div id='calendar'></div> <div id='calendar'></div>
<div id='popup' style="width: 500px; height: 600px; display: none; background-color: white; padding: 20px; border-radius: 14px; border: 2px solid #eeeeee"></div> <div id='popup'
</div> style="width: 500px; height: 600px; display: none; background-color: white; padding: 20px; border-radius: 14px; border: 2px solid #eeeeee"></div>
</div> </div>
</div>
<div class="row mt-4"> <div class="row mt-4">
<div class="col-md-5"> <div class="col-md-6">
<!-- 세 번째 공간 --> <!-- 세 번째 공간 -->
<div>세 번째 공간</div> <div>
</div> <div class=" text-center">
<h5>부족한 재고</h5>
</div>
<table class="table">
<thead class="table-dark">
<tr>
<th>번호</th>
<th>제품명</th>
<th>카테고리</th>
<th>재고수</th>
<th>창고</th>
</tr>
</thead>
<tbody>
<c:forEach items="${slist2 }" var="dto">
<tr class="detailTr col-5" data-id="${dto.id}" style="font-size: small;">
<td class="col-1">${start2} <c:set var="start2" value="${start2 +1 }"/></td>
<td class="col-1">${dto.productName }</td>
<td class="col-1">${dto.cls_nm_4 }</td>
<td class="col-1">${dto.quantity }</td>
<td class="col-1">${dto.warehouseName}</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
<div class="col-md-5"> <div class="col-md-6">
<!-- 네 번째 공간 --> <!-- 네 번째 공간 -->
<div>네 번째 공간</div> <div>네 번째 공간</div>
</div> </div>
</div> </div>
</div> </div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<link href='/resources/static/css/fullcalendar.main.min.css' rel='stylesheet'/>
<script src='/resources/static/js/ko.js'></script>
<script src='/resources/static/js/fullcalendar.main.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bPopup/0.11.0/jquery.bpopup.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('calendar');
var calendar = new FullCalendar.Calendar(calendarEl, {
locale: "ko",
initialView: 'dayGridMonth',
headerToolbar: {
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
},
googleCalendarApiKey: 'AIzaSyBKWDNnFEMpuNCPubU3pkkmB1F6XLX_bSo',
events: {
googleCalendarId: '7a3e7ae86281b8e995e4db0402865fb947ceb73c7d633f3a629a0068ac0ca66c@group.calendar.google.com',
className: 'gcal-event' // an option!
},
eventClick: function (info) {
let start_year = info.event.start.getUTCFullYear();
let start_month = info.event.start.getMonth() + 1;
let start_date = info.event.start.getUTCDate();
let start_hour = info.event.start.getHours();
let start_minute = info.event.start.getMinutes();
let start_second = info.event.start.getSeconds();
let end_hour = info.event.end.getHours();
let start = start_year + "-" + start_month + "-" + start_date + " " + start_hour + "시 ~ " + end_hour + "시";
console.log(start);
let attends = "";
info.event.extendedProps.attachments.forEach(function (item) {
attends += "<div><a href='" + item.fileUrl + "' target='_blank'>[첨부파일]</a></div>"
});
if (!info.event.extendedProps.description) {
info.event.extendedProps.description = "";
}
let contents = "<div style='font-weight:bold; font-size:20px; margin-bottom:30px; text-align:center'>" +
start +
"</div>" +
"<div style='font-size:18px; margin-bottom:20px'>" +
"제목: " + info.event.title +
"</div>" +
"<div style='width:500px'>" +
info.event.extendedProps.description +
attends +
"</div>";
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> $("#popup").html(contents);
<link href='/resources/static/css/fullcalendar.main.min.css' rel='stylesheet' /> $("#popup").bPopup({
<script src='/resources/static/js/ko.js'></script> speed: 500,
<script src='/resources/static/js/fullcalendar.main.min.js'></script> transition: 'slideIn',
<script src="https://cdnjs.cloudflare.com/ajax/libs/bPopup/0.11.0/jquery.bpopup.min.js"></script> transitionClose: 'slideBack',
<script> position: [($(document).width() - 500) / 2, 30] //x, y
document.addEventListener('DOMContentLoaded', function() { });
var calendarEl = document.getElementById('calendar'); info.jsEvent.stopPropagation();
var calendar = new FullCalendar.Calendar(calendarEl, { info.jsEvent.preventDefault();
locale: "ko", }
initialView: 'dayGridMonth', });
headerToolbar: { calendar.render();
left: 'prev,next today', });
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
},
googleCalendarApiKey: 'AIzaSyBKWDNnFEMpuNCPubU3pkkmB1F6XLX_bSo',
events: {
googleCalendarId: '7a3e7ae86281b8e995e4db0402865fb947ceb73c7d633f3a629a0068ac0ca66c@group.calendar.google.com',
className: 'gcal-event' // an option!
},
eventClick: function(info) {
let start_year = info.event.start.getUTCFullYear();
let start_month = info.event.start.getMonth() + 1;
let start_date = info.event.start.getUTCDate();
let start_hour = info.event.start.getHours();
let start_minute = info.event.start.getMinutes();
let start_second = info.event.start.getSeconds();
let end_hour = info.event.end.getHours();
let start = start_year + "-" + start_month + "-" + start_date + " " + start_hour + "시 ~ " + end_hour + "시"; $(document).ready(function () {
console.log(start); $("body").on("click", ".detailTr", function () {
let attends = ""; var id = $(this).data("id");
info.event.extendedProps.attachments.forEach(function(item) {
attends += "<div><a href='"+item.fileUrl+"' target='_blank'>[첨부파일]</a></div>"
});
if(!info.event.extendedProps.description) { var form = document.createElement("form");
info.event.extendedProps.description = ""; form.action = "/stock/read";
} form.method = "POST";
let contents = "<div style='font-weight:bold; font-size:20px; margin-bottom:30px; text-align:center'>" + document.body.appendChild(form);
start +
"</div>" +
"<div style='font-size:18px; margin-bottom:20px'>" +
"제목: " + info.event.title +
"</div>" +
"<div style='width:500px'>" +
info.event.extendedProps.description +
attends +
"</div>";
$("#popup").html(contents); var input = document.createElement("input");
$("#popup").bPopup({ input.type = "hidden";
speed: 500, input.name = "id";
transition: 'slideIn', input.value = id;
transitionClose: 'slideBack', form.appendChild(input);
position: [($(document).width()-500)/2, 30] //x, y
}); form.submit();
info.jsEvent.stopPropagation();
info.jsEvent.preventDefault(); });
} });
}); </script>
calendar.render();
});
</script>
</body> </body>
</html> </html>