From b305bed7fda6e78520af375bc3d964ebb41e36a9 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Tue, 21 May 2024 10:26:00 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/mapper/base/actiongroup-mapper.xml | 5 +++-- .../WEB-INF/jsp/base/authority/actionGroup-list.jsp | 2 +- src/main/webapp/resources/js/base/actionGroup.js | 12 ++++++++---- src/main/webapp/resources/js/base/base.js | 9 ++++----- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/resources/sql/mapper/base/actiongroup-mapper.xml b/src/main/resources/sql/mapper/base/actiongroup-mapper.xml index f42bb2ee..14ea855d 100644 --- a/src/main/resources/sql/mapper/base/actiongroup-mapper.xml +++ b/src/main/resources/sql/mapper/base/actiongroup-mapper.xml @@ -48,11 +48,12 @@ DELETE FROM TB_ACTION_GRP WHERE GRP_ID IN (#{groupID}) + + /* 그룹별 기능 추가(actionGroupMapper.addActions) */ INSERT INTO TB_GRP_ACTION (GRP_ID, ACTION, REG_DT, RGTR) diff --git a/src/main/webapp/WEB-INF/jsp/base/authority/actionGroup-list.jsp b/src/main/webapp/WEB-INF/jsp/base/authority/actionGroup-list.jsp index 12b27b34..1cbb834f 100644 --- a/src/main/webapp/WEB-INF/jsp/base/authority/actionGroup-list.jsp +++ b/src/main/webapp/WEB-INF/jsp/base/authority/actionGroup-list.jsp @@ -67,7 +67,7 @@ ${infoPrefix}Control.onActionListChange = obj => { start:obj.actionStart, totalSize:obj.actionTotal, fetchSize:obj.actionFetch, - func:"${infoPrefix}Control.actions.load({index})" + func:"${infoPrefix}Control.getActions({index})" }); }; diff --git a/src/main/webapp/resources/js/base/actionGroup.js b/src/main/webapp/resources/js/base/actionGroup.js index 576847ec..7377ee3b 100644 --- a/src/main/webapp/resources/js/base/actionGroup.js +++ b/src/main/webapp/resources/js/base/actionGroup.js @@ -38,10 +38,9 @@ class ActionGroupControl { if (!this.linked) return; let row = item ? item.data : null; - if (row) { - this.actions.query.groupIDs = row.GRP_ID; - this.actions.load(); - } else + if (row) + this.getActions(row.GRP_ID, 1); + else this.actions.dataset.clear(); }; this.groups.onSelectionChange = selected => this.onGroupSelect(selected); @@ -81,6 +80,11 @@ class ActionGroupControl { onActionSelect(selected) {} + getActions(groupID, pageNum) { + this.actions.query.groupIDs = groupID; + this.actions.load(pageNum); + } + async addActions() { let actions = await selectURL(true); actions = actions.filter(a => "/" == a || a.endsWith(".do")); diff --git a/src/main/webapp/resources/js/base/base.js b/src/main/webapp/resources/js/base/base.js index 04fcbe76..be756fe3 100644 --- a/src/main/webapp/resources/js/base/base.js +++ b/src/main/webapp/resources/js/base/base.js @@ -633,11 +633,10 @@ $.fn.setPaging = function(config) { config.last = function(index, label) {return '
  • '.replace(/{func}/, config.func.replace(/{index}/, label));}; return this.each(function(){ - let list = config.list; - let pagingInfo = list.empty ? "" : 1 - + " ~ " - + numberFormat.format(list.length) - + " / " + numberFormat.format(config.totalSize); + let list = config.list, + start = list.empty ? 0 : config.start + 1, + end = list.empty ? 0 : config.start + list.length, + pagingInfo = list.empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize); $("#"+ config.prefix + "PagingInfo").html(pagingInfo); let tag = paginate(config),