페이징 수정

main
mjkhan21 6 months ago
parent 527f43c258
commit b305bed7fd

@ -48,11 +48,12 @@ DELETE FROM TB_ACTION_GRP
WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</delete> WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</delete>
<select id="getActionList" parameterType="map" resultType="dataobject">/* 그룹별 기능 가져오기(actionGroupMapper.getActionList) */ <select id="getActionList" parameterType="map" resultType="dataobject">/* 그룹별 기능 가져오기(actionGroupMapper.getActionList) */
<include refid="utility.paging-prefix" />
SELECT * SELECT *
FROM TB_GRP_ACTION FROM TB_GRP_ACTION
<if test="groupIDs != null">WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if> <if test="groupIDs != null">WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
ORDER BY GRP_ID, ACTION <include refid="utility.orderBy" />
</select> <include refid="utility.paging-suffix" /></select>
<insert id="addActions" parameterType="map">/* 그룹별 기능 추가(actionGroupMapper.addActions) */ <insert id="addActions" parameterType="map">/* 그룹별 기능 추가(actionGroupMapper.addActions) */
INSERT INTO TB_GRP_ACTION (GRP_ID, ACTION, REG_DT, RGTR) INSERT INTO TB_GRP_ACTION (GRP_ID, ACTION, REG_DT, RGTR)

@ -67,7 +67,7 @@ ${infoPrefix}Control.onActionListChange = obj => {
start:obj.actionStart, start:obj.actionStart,
totalSize:obj.actionTotal, totalSize:obj.actionTotal,
fetchSize:obj.actionFetch, fetchSize:obj.actionFetch,
func:"${infoPrefix}Control.actions.load({index})" func:"${infoPrefix}Control.getActions({index})"
}); });
}; };

@ -38,10 +38,9 @@ class ActionGroupControl {
if (!this.linked) return; if (!this.linked) return;
let row = item ? item.data : null; let row = item ? item.data : null;
if (row) { if (row)
this.actions.query.groupIDs = row.GRP_ID; this.getActions(row.GRP_ID, 1);
this.actions.load(); else
} else
this.actions.dataset.clear(); this.actions.dataset.clear();
}; };
this.groups.onSelectionChange = selected => this.onGroupSelect(selected); this.groups.onSelectionChange = selected => this.onGroupSelect(selected);
@ -81,6 +80,11 @@ class ActionGroupControl {
onActionSelect(selected) {} onActionSelect(selected) {}
getActions(groupID, pageNum) {
this.actions.query.groupIDs = groupID;
this.actions.load(pageNum);
}
async addActions() { async addActions() {
let actions = await selectURL(true); let actions = await selectURL(true);
actions = actions.filter(a => "/" == a || a.endsWith(".do")); actions = actions.filter(a => "/" == a || a.endsWith(".do"));

@ -633,11 +633,10 @@ $.fn.setPaging = function(config) {
config.last = function(index, label) {return '<li onclick="{func}" class="page-item last"><a class="page-link"><i class="tf-icon bx bx-chevrons-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));}; config.last = function(index, label) {return '<li onclick="{func}" class="page-item last"><a class="page-link"><i class="tf-icon bx bx-chevrons-right"></i></a></li>'.replace(/{func}/, config.func.replace(/{index}/, label));};
return this.each(function(){ return this.each(function(){
let list = config.list; let list = config.list,
let pagingInfo = list.empty ? "" : 1 start = list.empty ? 0 : config.start + 1,
+ " ~ " end = list.empty ? 0 : config.start + list.length,
+ numberFormat.format(list.length) pagingInfo = list.empty ? "" : start + " ~ " + numberFormat.format(end) + " / " + numberFormat.format(config.totalSize);
+ " / " + numberFormat.format(config.totalSize);
$("#"+ config.prefix + "PagingInfo").html(pagingInfo); $("#"+ config.prefix + "PagingInfo").html(pagingInfo);
let tag = paginate(config), let tag = paginate(config),

Loading…
Cancel
Save