Prechádzať zdrojové kódy

footer and paging update

juhankim 2 rokov pred
rodič
commit
94239920be
22 zmenil súbory, kde vykonal 34 pridanie a 48 odobranie
  1. 1 1
      src/main/java/com/example/ili_web/board/repository/BoardRepositoryDsl.java
  2. 1 5
      src/main/resources/static/js/business-sector/bizChangeInner.js
  3. 13 8
      src/main/resources/static/js/contact/getList.js
  4. 6 5
      src/main/resources/static/js/contact/makeHtml.js
  5. 1 2
      src/main/resources/templates/html/about-inner/ceo.html
  6. 0 1
      src/main/resources/templates/html/about-inner/history.html
  7. 1 2
      src/main/resources/templates/html/about-inner/intro.html
  8. 1 3
      src/main/resources/templates/html/about-inner/philosophy.html
  9. 1 0
      src/main/resources/templates/html/about.html
  10. 0 1
      src/main/resources/templates/html/business-inner/airplane.html
  11. 1 2
      src/main/resources/templates/html/business-inner/border.html
  12. 0 1
      src/main/resources/templates/html/business-inner/consult.html
  13. 1 2
      src/main/resources/templates/html/business-inner/ecommerce.html
  14. 0 1
      src/main/resources/templates/html/business-inner/global.html
  15. 0 1
      src/main/resources/templates/html/business-inner/logistics.html
  16. 0 1
      src/main/resources/templates/html/business-inner/multi.html
  17. 0 1
      src/main/resources/templates/html/business-inner/ship.html
  18. 0 2
      src/main/resources/templates/html/business-inner/special-cargo.html
  19. 0 1
      src/main/resources/templates/html/business-inner/train-inner.html
  20. 1 1
      src/main/resources/templates/html/business-sector.html
  21. 5 5
      src/main/resources/templates/html/contact-inner/notice.html
  22. 1 2
      src/main/resources/templates/html/contact-us.html

+ 1 - 1
src/main/java/com/example/ili_web/board/repository/BoardRepositoryDsl.java

@@ -42,7 +42,7 @@ public class BoardRepositoryDsl {
                 .orderBy(b.id.desc())
                 .fetchOne();
         res.setDataList(bList);
-        total = total != null && total > 10 ? total / 10 : 1;
+        total = total != null && total > 5 ? (total / 5) + 1 : 1;
         res.setTotal(total);
         res.setPage(req.getPage());
         return res;

+ 1 - 5
src/main/resources/static/js/business-sector/bizChangeInner.js

@@ -13,11 +13,7 @@ async function changeInnerAjax(name) {
         .then(async (res) => {
             //element.insertAdjacentHTML('afterBegin', res.request.responseText);
             element.innerHTML = res.data;
-            const list = await getList(code, 1);
-            const target = findTarget(name);
-            makeTable(list.data.dataList, target, code);
-            pagenation(list.data, code);
-            clearModal();
+            await getList(code, 1, name);
         })
 }
 

+ 13 - 8
src/main/resources/static/js/contact/getList.js

@@ -1,16 +1,21 @@
-async function getList(type, page) {
-    try {
-        return await axios.post('/api/v1/board/list', {type, page, size: 5});
-    } catch (e) {
+async function getList(type, page, name) {
+    await axios.post('/api/v1/board/list', {type, page, size: 5})
+        .then(res => {
+            makeTable(res.data.dataList, name, type);
+            pagenation(res.data, type, name);
+            clearModal();
+        })
+        .catch(error => {
+
+        });
 
-    }
 }
 
 async function goToDetail(id) {
     const data = await getDetail(id);
-    document.getElementById('nt_dt').innerHTML = `<strong>일시:</strong> ${data.regDt}`;
-    document.getElementById('nt_name').innerHTML = `<strong>작성자:</strong> ${data.userName}`;
-    document.getElementById('nt_title').innerHTML = `<strong>제목:</strong> ${data.title}`;
+/*    document.getElementById('nt_dt').innerHTML = `<strong>일시:</strong> ${data.regDt}`;
+    document.getElementById('nt_name').innerHTML = `<strong>작성자:</strong> ${data.userName}`;*/
+    document.getElementById('nt_title').innerHTML = `${data.title}`;
     document.getElementById('nt_content').innerText = data.content;
 }
 

+ 6 - 5
src/main/resources/static/js/contact/makeHtml.js

@@ -1,4 +1,5 @@
-function makeTable(list, target, code) {
+function makeTable(list, name, code) {
+    const target = findTarget(name);
     target.innerHTML = '';
     let html = '';
 
@@ -15,24 +16,24 @@ function makeTable(list, target, code) {
     code !== 'LG' ? firstRowLink.click() : null;
 }
 
-function pagenation (data, type) {
+function pagenation (data, type, target) {
     let paginationHtml = '<ul class="pagination justify-content-center">';
 
     // Previous 버튼
     paginationHtml += '<li class="page-item ' + (data.page <= 1 ? 'disabled' : '') + '">';
-    paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${data.page - 1}')" tabindex="-1">이전</a>`;
+    paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${data.page - 1}', '${target}')" tabindex="-1">이전</a>`;
     paginationHtml += '</li>';
 
     // 페이지 번호
     for (let i = 1; i <= data.total; i++) {
         paginationHtml += '<li class="page-item ' + (i === data.page ? 'active' : '') + '">';
-        paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${i}')">${i}</a>`;
+        paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${i}', '${target}')">${i}</a>`;
         paginationHtml += '</li>';
     }
 
     // Next 버튼
     paginationHtml += '<li class="page-item ' + (data.page >= data.total ? 'disabled' : '') + '">';
-    paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${data.page + 1}')">다음</a>`;
+    paginationHtml += `<a class="page-link" href="javascript:void(0);" onclick="getList('${type}', '${data.page + 1}', '${target}')">다음</a>`;
     paginationHtml += '</li>';
     paginationHtml += '</ul>';
 

+ 1 - 2
src/main/resources/templates/html/about-inner/ceo.html

@@ -21,5 +21,4 @@
     </div>
     <div class="col-lg-1">
     </div>
-</div>
-<hr class="featurette-divider">
+</div>

+ 0 - 1
src/main/resources/templates/html/about-inner/history.html

@@ -58,5 +58,4 @@
     </div>
 </div>
 
-<hr class="featurette-divider">
 

+ 1 - 2
src/main/resources/templates/html/about-inner/intro.html

@@ -26,5 +26,4 @@
     <div class="col-md-6">
         <img alt="" src="/image/about/owner.png" class="img-fluid">
     </div>
-</div>
-<hr class="featurette-divider">
+</div>

+ 1 - 3
src/main/resources/templates/html/about-inner/philosophy.html

@@ -9,6 +9,4 @@
     </div>
     <div class="col-lg-3">
     </div>
-</div>
-
-<hr class="featurette-divider">
+</div>

+ 1 - 0
src/main/resources/templates/html/about.html

@@ -57,6 +57,7 @@
     <div class="container marketing" id="philosophy" th:include="html/about-inner/philosophy.html" style="display: none">
     </div>
 </main>
+<hr class="featurette-divider">
 <footer class="footer" th:include="html/common/footer"></footer>
 </body>
 <script src="/js/bootstrap.bundle.min.js"></script>

+ 0 - 1
src/main/resources/templates/html/business-inner/airplane.html

@@ -56,6 +56,5 @@
     <div class="col-md-6">
     </div>
 </div>
-<hr class="featurette-divider">
 
 

+ 1 - 2
src/main/resources/templates/html/business-inner/border.html

@@ -33,5 +33,4 @@
     </div>
     <!--<div class="col-lg-1">
     </div>-->
-</div>
-<hr class="featurette-divider">
+</div>

+ 0 - 1
src/main/resources/templates/html/business-inner/consult.html

@@ -21,4 +21,3 @@
     </div>
 </div>
 
-<hr class="featurette-divider">

+ 1 - 2
src/main/resources/templates/html/business-inner/ecommerce.html

@@ -16,5 +16,4 @@
     <div class="col-md-7 order-md-1">
         <img alt="" src="/image/business/ecommerce.jpg" class="img-fluid">
     </div>
-</div>
-<hr class="featurette-divider">
+</div>

+ 0 - 1
src/main/resources/templates/html/business-inner/global.html

@@ -32,6 +32,5 @@
 </div>
 
 
-<hr class="featurette-divider">
 
 

+ 0 - 1
src/main/resources/templates/html/business-inner/logistics.html

@@ -24,5 +24,4 @@
     <img alt="" src="/image/business/logistic.png">
 </div>
 
-<hr class="featurette-divider">
 

+ 0 - 1
src/main/resources/templates/html/business-inner/multi.html

@@ -39,6 +39,5 @@
 </div>
 
 
-<hr class="featurette-divider">
 
 

+ 0 - 1
src/main/resources/templates/html/business-inner/ship.html

@@ -42,6 +42,5 @@
         <img alt="" src="/image/business/ship3.jpg" class="img-fluid">
     </div>
 </div>
-<hr class="featurette-divider">
 
 

+ 0 - 2
src/main/resources/templates/html/business-inner/special-cargo.html

@@ -83,5 +83,3 @@
         <img src="/image/business/big-cargo3.jpg" alt="fish" class="img-fluid">
     </div>
 </div>
-
-<hr class="featurette-divider">

+ 0 - 1
src/main/resources/templates/html/business-inner/train-inner.html

@@ -38,6 +38,5 @@
     <!--<div class="col-lg-1">
     </div>-->
 </div>
-<hr class="featurette-divider">
 
 

+ 1 - 1
src/main/resources/templates/html/business-sector.html

@@ -76,7 +76,7 @@
     <div class="container marketing" th:include="html/business-inner/consult" id="inner-consult" style="display: none">
     </div>
 </main>
-
+<hr class="featurette-divider">
 <footer class="footer" th:include="html/common/footer">
 
 </footer>

+ 5 - 5
src/main/resources/templates/html/contact-inner/notice.html

@@ -11,7 +11,7 @@
 <div class="row" style="display: flex;">
     <!-- 왼쪽 영역: 문의 목록 표시 -->
     <div class="col-md-6">
-        <h3 class="text-center">공지 목록</h3>
+        <h3 class="text-center mb-5">공지 목록</h3>
         <table class="table table-striped" id="notice_table">
             <thead>
             <tr>
@@ -33,20 +33,20 @@
         <div class="row">
             <div class="container my-5">
                 <form>
-                    <div class="row g-3">
+                    <!--<div class="row g-3">
                         <div class="col mb-6 form-floating h-3">
-                            <!-- 일시, 제목, 작성자 표시 -->
+                            &lt;!&ndash; 일시, 제목, 작성자 표시 &ndash;&gt;
                             <p id="nt_dt"></p>
                             <p id="nt_title"></p>
                             <p id="nt_name"></p>
                         </div>
-                    </div>
+                    </div>-->
                     <!-- 내용 표시 textarea -->
                     <div class="mb-3 form-floating">
                         <div class="col input-group mb-3 form-floating">
                         <textarea class="form-control" id="nt_content" placeholder="문의 내용을 여기에 표시합니다." readonly
                                   rows="5" style="height: 300px"></textarea>
-                            <label class="form-label" for="nt_content" style="visibility: hidden">내용</label>
+                            <label class="form-label" for="nt_content" id="nt_title">내용</label>
                         </div>
                     </div>
                 </form>

+ 1 - 2
src/main/resources/templates/html/contact-us.html

@@ -50,9 +50,8 @@
 
     <div class="container marketing" id="notice">
     </div>
-    <hr class="featurette-divider">
 </main>
-
+<hr class="featurette-divider">
 <footer class="footer" th:include="html/common/footer">
 
 </footer>