Merge branch 'main' into feat_samplePage
commit
2f8f820357
@ -1,139 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper">
|
||||
<!-- SQL 페이징 코드 -->
|
||||
<sql id="pageBefore">
|
||||
SELECT * FROM
|
||||
(SELECT LIST.*, ROWNUM AS "RN" FROM(
|
||||
</sql>
|
||||
|
||||
<sql id="pageAfter">
|
||||
) LIST
|
||||
) WHERE RN BETWEEN #{firstIndex} + 1 AND #{firstIndex} + #{recordCountPerPage}
|
||||
</sql>
|
||||
|
||||
|
||||
<sql id="findList_SELECT">
|
||||
SELECT A.AUTHOR_CODE AS "authorCode"
|
||||
,A.AUTHOR_NM AS "authorNm"
|
||||
,A.AUTHOR_DC AS "authorDc"
|
||||
,A.AUTHOR_CREAT_DE AS "authorCreatDe"
|
||||
</sql>
|
||||
<sql id="findList_FROM">
|
||||
FROM XIT_AUTHOR_INFO A
|
||||
</sql>
|
||||
<sql id="findList_WHERE">
|
||||
<if test="'1'.toString() == searchCondition">
|
||||
AND A.AUTHOR_NM LIKE '%'||#{searchKeyword}||'%'
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO">
|
||||
/** XitAuthRegMngMapper.findList */
|
||||
/** 권한관리 목록 조회 */
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageBefore" />
|
||||
</if>
|
||||
|
||||
<include refid="findList_SELECT"/>
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE 1=1
|
||||
<include refid="findList_WHERE"/>
|
||||
ORDER BY A.AUTHOR_CREAT_DE DESC
|
||||
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageAfter" />
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findListTotCnt" resultType="int">
|
||||
/** XitAuthRegMngMapper.findListTotCnt */
|
||||
/** 권한관리 목록 총건수 조회 */
|
||||
SELECT COUNT(1) AS "CNT"
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE 1=1
|
||||
<include refid="findList_WHERE"/>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO">
|
||||
/** XitAuthRegMngMapper.findView */
|
||||
/** 권한관리 상세정보 조회 */
|
||||
<include refid="findList_SELECT"/>
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE A.AUTHOR_CODE=#{authorCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="findListAuthorRole" resultType="java.util.Map">
|
||||
/** XitAuthRegMngMapper.findListAuthorRole */
|
||||
/** 권한롤관리 목록 조회 */
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageBefore"/>
|
||||
</if>
|
||||
|
||||
<include refid="findListAuthorRole_SELECT"/>
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
ORDER BY A.ROLE_CODE
|
||||
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageAfter"/>
|
||||
</if>
|
||||
</select>
|
||||
<select id="findListAuthorRoleTotCnt" resultType="int">
|
||||
/** XitAuthRegMngMapper.findListAuthorRoleTotCnt */
|
||||
/** 권한롤관리 목록 조회 총 건수 */
|
||||
SELECT COUNT(1) AS "CNT"
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
</select>
|
||||
<sql id="findListAuthorRole_SELECT">
|
||||
SELECT A.ROLE_CODE AS "roleCode"
|
||||
,A.ROLE_NM AS "roleNm"
|
||||
,A.ROLE_PTTRN AS "rolePtn"
|
||||
,A.ROLE_DC AS "roleDc"
|
||||
,A.ROLE_TY AS "roleTyp"
|
||||
,A.ROLE_SORT AS "roleSort"
|
||||
,B.AUTHOR_CODE AS "authorCode"
|
||||
,B.CREAT_DT AS "creatDt"
|
||||
,(CASE WHEN B.ROLE_CODE IS NULL THEN 'N' ELSE 'Y' END) AS "regYn"
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_FROM">
|
||||
FROM XIT_ROLE_INFO A
|
||||
LEFT OUTER JOIN ( SELECT AUTHOR_CODE, ROLE_CODE, CREAT_DT
|
||||
FROM XIT_AUTHOR_ROLE_RELATE
|
||||
WHERE AUTHOR_CODE = #{searchKeyword}
|
||||
) B ON A.ROLE_CODE = B.ROLE_CODE
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_WHERE">
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper">
|
||||
|
||||
<!-- *************************************************************************************************************
|
||||
* xit_author_info : 권한 정보
|
||||
************************************************************************************************************** -->
|
||||
<select id="selectAuthorInfos" parameterType="map" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
|
||||
SELECT author_code
|
||||
, author_nm
|
||||
, author_dc
|
||||
, author_creat_de
|
||||
FROM xit_author_info
|
||||
<where>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorCode)">
|
||||
AND author_code = #{authorCode}
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorNm)">
|
||||
AND INSTR(author_nm, #{authorNm}) > 0
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(authorDc)">
|
||||
AND INSTR(author_dc, #{authorDc}) > 0
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY author_creat_de DESC
|
||||
</select>
|
||||
|
||||
<select id="selectAuthorInfo" parameterType="string" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/* auth-author-mysql-mapper|selectAuthorInfo-권한 정보 조회|julim */
|
||||
SELECT author_code
|
||||
, author_nm
|
||||
, author_dc
|
||||
, author_creat_de
|
||||
FROM xit_author_info
|
||||
WHERE author_code = #{authorCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/* auth-author-mysql-mapper|insertAuthorInfo-권한 정보 등록|julim */
|
||||
INSERT INTO xit_author_info (
|
||||
author_code
|
||||
, author_nm
|
||||
, author_dc
|
||||
, author_creat_de
|
||||
) VALUES (
|
||||
#{authorCode}
|
||||
,#{authorNm}
|
||||
,#{authorDc}
|
||||
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
|
||||
UPDATE xit_author_info
|
||||
SET author_nm = IF(author_nm = #{authorNm}, author_nm, #{authorNm})
|
||||
, author_dc = IF(author_dc = #{authorDc}, author_dc, #{authorDc})
|
||||
WHERE author_code = #{authorCode}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAuthorInfo" parameterType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/* auth-author-mysql-mapper|selectAuthorInfos-권한 목록 조회|julim */
|
||||
DELETE
|
||||
FROM xit_author_info
|
||||
WHERE author_code = #{authorCode}
|
||||
</delete>
|
||||
|
||||
|
||||
<select id="selectAuthRoleGrantList" resultType="kr.xit.framework.biz.cmm.model.XitRoleInfoVO">
|
||||
/* auth-author-mysql-mapper|selectAuthRoleGrantList- 권한별 롤 조회|julim */
|
||||
SELECT xri.role_code
|
||||
, xri.role_nm
|
||||
, xri.role_pttrn
|
||||
, xri.role_dc
|
||||
, xri.role_ty
|
||||
, xri.role_sort
|
||||
, DATE_FORMAT(arr.creat_dt, '%Y%m%d%H%i%s') AS creatDt
|
||||
, IF(arr.role_code IS NULL, 'N', 'Y') AS "regYn"
|
||||
FROM xit_role_info xri
|
||||
LEFT OUTER JOIN ( SELECT author_code
|
||||
, role_code
|
||||
, creat_dt
|
||||
FROM xit_author_role_relate
|
||||
WHERE author_code = #{authorCode}
|
||||
) arr
|
||||
ON xri.role_code = arr.role_code
|
||||
ORDER BY arr.role_code DESC, xri.role_sort
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleGrant" parameterType="map">
|
||||
/* auth-author-mysql-mapper|deleteRoleGrant-권한 롤 삭제|julim */
|
||||
DELETE
|
||||
FROM xit_author_role_relate
|
||||
WHERE author_code = #{authorCode}
|
||||
AND role_code = #{roleCode}
|
||||
</delete>
|
||||
|
||||
<delete id="saveRoleGrant" parameterType="map">
|
||||
/* auth-author-mysql-mapper|saveRoleGrant-권한 롤 등록|julim */
|
||||
INSERT INTO xit_author_role_relate (
|
||||
author_code
|
||||
, role_code
|
||||
, creat_dt
|
||||
) VALUES (
|
||||
#{authorCode}
|
||||
, #{roleCode}
|
||||
, NOW()
|
||||
)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
creat_dt = NOW()
|
||||
</delete>
|
||||
|
||||
<!-- *************************************************************************************************************
|
||||
* xit_role_sclsrt_rescue : 역할 계층 정보
|
||||
************************************************************************************************************** -->
|
||||
<select id="selectRoleSclsrtRescues" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
|
||||
/* auth-author-mysql-mapper|selectRoleSclsrtRescues-역할계층 조회|julim */
|
||||
SELECT parnts_role
|
||||
, chldrn_role
|
||||
FROM xit_role_sclsrt_rescue
|
||||
<where>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
|
||||
AND parnts_role = #{parntsRole}
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
|
||||
AND chldrn_role = #{chldrnRole}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO" resultType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
|
||||
/* auth-author-mysql-mapper|selectRoleSclsrtRescue-역할계층 정보 조회|julim */
|
||||
SELECT parnts_role
|
||||
, chldrn_role
|
||||
FROM xit_role_sclsrt_rescue
|
||||
WHERE parnts_role = #{parntsRole}
|
||||
AND chldrn_role = #{chldrnRole}
|
||||
</select>
|
||||
<insert id="insertRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
|
||||
/* auth-author-mysql-mapper|insertRoleSclsrtRescue-역할계층 정보 등록|julim */
|
||||
INSERT
|
||||
INTO xit_role_sclsrt_rescue(
|
||||
parnts_role
|
||||
, chldrn_role
|
||||
)VALUES(
|
||||
#{parntsRole}
|
||||
, #{chldrnRole}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteRoleSclsrtRescue" parameterType="kr.xit.framework.biz.cmm.model.XitRoleSclsrtRescueVO">
|
||||
/* auth-author-mysql-mapper|deleteRoleSclsrtRescue-역할계층 삭제 조회|julim */
|
||||
DELETE
|
||||
FROM xit_role_sclsrt_rescue
|
||||
<where>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parntsRole)">
|
||||
AND parnts_role = #{parntsRole}
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(chldrnRole)">
|
||||
AND chldrn_role = #{chldrnRole}
|
||||
</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="findListAuthorRole" resultType="java.util.Map">
|
||||
/** XitAuthRegMngMapper.findListAuthorRole */
|
||||
/** 권한롤관리 목록 조회 */
|
||||
|
||||
|
||||
<include refid="findListAuthorRole_SELECT"/>
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
ORDER BY A.ROLE_CODE
|
||||
|
||||
|
||||
</select>
|
||||
<select id="findListAuthorRoleTotCnt" resultType="int">
|
||||
/** XitAuthRegMngMapper.findListAuthorRoleTotCnt */
|
||||
/** 권한롤관리 목록 조회 총 건수 */
|
||||
SELECT COUNT(1) AS "CNT"
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
</select>
|
||||
<sql id="findListAuthorRole_SELECT">
|
||||
SELECT A.ROLE_CODE AS "roleCode"
|
||||
,A.ROLE_NM AS "roleNm"
|
||||
,A.ROLE_PTTRN AS "rolePtn"
|
||||
,A.ROLE_DC AS "roleDc"
|
||||
,A.ROLE_TY AS "roleTyp"
|
||||
,A.ROLE_SORT AS "roleSort"
|
||||
,B.AUTHOR_CODE AS "authorCode"
|
||||
,B.CREAT_DT AS "creatDt"
|
||||
,(CASE WHEN B.ROLE_CODE IS NULL THEN 'N' ELSE 'Y' END) AS "regYn"
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_FROM">
|
||||
FROM XIT_ROLE_INFO A
|
||||
LEFT OUTER JOIN ( SELECT AUTHOR_CODE, ROLE_CODE, CREAT_DT
|
||||
FROM XIT_AUTHOR_ROLE_RELATE
|
||||
WHERE AUTHOR_CODE = #{searchKeyword}
|
||||
) B ON A.ROLE_CODE = B.ROLE_CODE
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_WHERE">
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -1,207 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="kr.xit.framework.biz.mng.auth.mapper.AuthMgtMapper">
|
||||
|
||||
<!-- *************************************************************************************************************
|
||||
* xit_user_info : 업무사용자 정보
|
||||
************************************************************************************************************** -->
|
||||
<select id="findXitAuthorInfos" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/** findXitAuthorInfos */
|
||||
/** 권한정보 다건 조회 */
|
||||
SELECT AUTHOR_CODE
|
||||
,AUTHOR_NM
|
||||
,AUTHOR_DC
|
||||
,AUTHOR_CREAT_DE
|
||||
FROM XIT_AUTHOR_INFO
|
||||
WHERE 1=1
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_code )">AND AUTHOR_CODE = #{author_code }</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm )">AND AUTHOR_NM = #{author_nm }</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc )">AND AUTHOR_DC = #{author_dc }</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_creat_de)">AND AUTHOR_CREAT_DE = #{author_creat_de}</if>
|
||||
</select>
|
||||
<select id="findXitAuthorInfo" resultType="kr.xit.framework.biz.cmm.model.XitAuthorInfoVO">
|
||||
/** findXitAuthorInfo */
|
||||
/** 권한정보 조회 */
|
||||
SELECT AUTHOR_CODE
|
||||
,AUTHOR_NM
|
||||
,AUTHOR_DC
|
||||
,AUTHOR_CREAT_DE
|
||||
FROM XIT_AUTHOR_INFO
|
||||
WHERE 1=1
|
||||
AND AUTHOR_CODE = #{author_code}
|
||||
</select>
|
||||
<insert id="addXitAuthorInfo">
|
||||
/** addXitAuthorInfo */
|
||||
/** 권한정보 등록 */
|
||||
INSERT INTO XIT_AUTHOR_INFO(
|
||||
AUTHOR_CODE
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,AUTHOR_NM</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,AUTHOR_DC</if>
|
||||
,AUTHOR_CREAT_DE
|
||||
)VALUES(
|
||||
#{author_code }
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_nm)">,#{author_nm }</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(author_dc)">,#{author_dc }</if>
|
||||
,DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
|
||||
)
|
||||
</insert>
|
||||
<update id="modifyXitAuthorInfo">
|
||||
/** modifyXitAuthorInfo */
|
||||
/** 권한정보 수정 */
|
||||
UPDATE XIT_AUTHOR_INFO
|
||||
SET
|
||||
AUTHOR_CREAT_DE = AUTHOR_CREAT_DE
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_nm)">,AUTHOR_NM = #{author_nm}</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notBlank(author_dc)">,AUTHOR_DC = #{author_dc}</if>
|
||||
WHERE 1=1
|
||||
AND AUTHOR_CODE = #{author_code}
|
||||
</update>
|
||||
<delete id="removeXitAuthorInfo">
|
||||
/** removeXitAuthorInfo */
|
||||
/** 권한정보 삭제 */
|
||||
DELETE FROM XIT_AUTHOR_INFO
|
||||
WHERE 1=1
|
||||
AND AUTHOR_CODE = #{author_code}
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- SQL 페이징 코드 -->
|
||||
<sql id="pageBefore">
|
||||
SELECT LIST.* FROM(
|
||||
</sql>
|
||||
|
||||
<sql id="pageAfter">
|
||||
) LIST LIMIT #{firstIndex}, #{recordCountPerPage}
|
||||
</sql>
|
||||
|
||||
|
||||
<sql id="findList_SELECT">
|
||||
SELECT A.AUTHOR_CODE AS "authorCode"
|
||||
,A.AUTHOR_NM AS "authorNm"
|
||||
,A.AUTHOR_DC AS "authorDc"
|
||||
,A.AUTHOR_CREAT_DE AS "authorCreatDe"
|
||||
</sql>
|
||||
<sql id="findList_FROM">
|
||||
FROM XIT_AUTHOR_INFO A
|
||||
</sql>
|
||||
<sql id="findList_WHERE">
|
||||
<if test="'1'.toString() == searchCondition">
|
||||
AND A.AUTHOR_NM LIKE CONCAT('%',#{searchKeyword},'%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<select id="findList" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO">
|
||||
/** XitAuthRegMngMapper.findList */
|
||||
/** 권한관리 목록 조회 */
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageBefore" />
|
||||
</if>
|
||||
|
||||
<include refid="findList_SELECT"/>
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE 1=1
|
||||
<include refid="findList_WHERE"/>
|
||||
ORDER BY A.AUTHOR_CREAT_DE DESC
|
||||
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageAfter" />
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findListTotCnt" resultType="int">
|
||||
/** XitAuthRegMngMapper.findListTotCnt */
|
||||
/** 권한관리 목록 총건수 조회 */
|
||||
SELECT COUNT(1) AS "CNT"
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE 1=1
|
||||
<include refid="findList_WHERE"/>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findView" resultType="kr.xit.framework.biz.mng.auth.model.XitAuthRegMngVO">
|
||||
/** XitAuthRegMngMapper.findView */
|
||||
/** 권한관리 상세정보 조회 */
|
||||
<include refid="findList_SELECT"/>
|
||||
<include refid="findList_FROM"/>
|
||||
WHERE A.AUTHOR_CODE=#{authorCode}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="findListAuthorRole" resultType="java.util.Map">
|
||||
/** XitAuthRegMngMapper.findListAuthorRole */
|
||||
/** 권한롤관리 목록 조회 */
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageBefore"/>
|
||||
</if>
|
||||
|
||||
<include refid="findListAuthorRole_SELECT"/>
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
ORDER BY A.ROLE_CODE
|
||||
|
||||
<if test="searchGubun == 'list'">
|
||||
<include refid="pageAfter"/>
|
||||
</if>
|
||||
</select>
|
||||
<select id="findListAuthorRoleTotCnt" resultType="int">
|
||||
/** XitAuthRegMngMapper.findListAuthorRoleTotCnt */
|
||||
/** 권한롤관리 목록 조회 총 건수 */
|
||||
SELECT COUNT(1) AS "CNT"
|
||||
<include refid="findListAuthorRole_FROM"/>
|
||||
WHERE 1 = 1
|
||||
<include refid="findListAuthorRole_WHERE"/>
|
||||
</select>
|
||||
<sql id="findListAuthorRole_SELECT">
|
||||
SELECT A.ROLE_CODE AS "roleCode"
|
||||
,A.ROLE_NM AS "roleNm"
|
||||
,A.ROLE_PTTRN AS "rolePtn"
|
||||
,A.ROLE_DC AS "roleDc"
|
||||
,A.ROLE_TY AS "roleTyp"
|
||||
,A.ROLE_SORT AS "roleSort"
|
||||
,B.AUTHOR_CODE AS "authorCode"
|
||||
,B.CREAT_DT AS "creatDt"
|
||||
,(CASE WHEN B.ROLE_CODE IS NULL THEN 'N' ELSE 'Y' END) AS "regYn"
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_FROM">
|
||||
FROM XIT_ROLE_INFO A
|
||||
LEFT OUTER JOIN ( SELECT AUTHOR_CODE, ROLE_CODE, CREAT_DT
|
||||
FROM XIT_AUTHOR_ROLE_RELATE
|
||||
WHERE AUTHOR_CODE = #{searchKeyword}
|
||||
) B ON A.ROLE_CODE = B.ROLE_CODE
|
||||
</sql>
|
||||
<sql id="findListAuthorRole_WHERE">
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%-- TODO: 완료후 comment 삭제
|
||||
아래와 같이 isUpdate 정의 필요
|
||||
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
|
||||
--%>
|
||||
<!-- popup button -->
|
||||
<div class="popup_btn">
|
||||
<span class="flr">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<a href="#" class="btn blue" id="btnModify">변경</a>
|
||||
<a href="#" class="btn red" id="btnRemove">삭제</a>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<a href="#" class="btn blue" id="btnRegist">등록</a>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
|
||||
</span>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<%-- TODO: 완료후 comment 삭제
|
||||
아래와 같이 isUpdate 정의 필요
|
||||
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
|
||||
<c:set var="bizName" value="권한그룹"/>
|
||||
--%>
|
||||
<!-- popup title -->
|
||||
<p class="pop_title">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<c:out value="${bizName}"/> 변경
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:out value="${bizName}"/> 등록
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</p>
|
||||
|
@ -0,0 +1,135 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
|
||||
<c:set var="isUpdate" value="${!empty authorInfoVO.authorCode}"/>
|
||||
<c:set var="bizName" value="권한"/>
|
||||
|
||||
<form>
|
||||
<div class="popup" style="min-width: 400px;">
|
||||
<div class="popup_inner" style="max-width: 400px;">
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
|
||||
|
||||
<table class="tbl03">
|
||||
<caption><c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/></caption>
|
||||
<colgroup>
|
||||
<col style="width: 20%;"/>
|
||||
<col/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한코드</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<input name="authorCode" id="authorCode" type="text" value="<c:out value='${authorInfoVO.authorCode}'/>" readonly size="40" title="권한코드" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input name="authorCode" id="authorCode" type="text" size="40" title="권한코드" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="authorNm" id="authorNm" type="text" value="<c:out value='${authorInfoVO.authorNm}'/>" maxLength="50" size="40" title="권한명" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>설명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="authorDc" id="authorDc" type="text" value="<c:out value='${authorInfoVO.authorDc}'/>" maxLength="50" size="50" title="설명" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>등록일자</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="authorCreatDe" id="authorCreatDe" type="text" value="<c:out value='${authorInfoVO.authorCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javaScript">
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
add: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('add', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/addAuthAuthor.do"/>'
|
||||
,data: $("form").serialize()
|
||||
//,contentType: 'x-www-form-url-encoded'
|
||||
})
|
||||
}
|
||||
|
||||
,modify: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('modify', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/modifyAuthAuthor.do"/>'
|
||||
,data: $("form").serialize()
|
||||
});
|
||||
}
|
||||
|
||||
, remove: () => {
|
||||
cmmBizAjax('remove', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/removeAuthAuthor.do"/>'
|
||||
,data: {authorCode: $('#authorCode').val()}
|
||||
});
|
||||
}
|
||||
|
||||
,validate: () => {
|
||||
if($('#authorCode').val() === ''){
|
||||
alert('[권한코드]는 필수 입니다.');
|
||||
$('#authorCode').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#authorNm').val() === ''){
|
||||
alert('[권한명]은 필수 입니다.');
|
||||
$('#authorNm').focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnRegist').on('click', () => fnBiz.add());
|
||||
|
||||
$('#btnModify').on('click', () => fnBiz.modify());
|
||||
|
||||
$('#btnRemove').on('click', () => fnBiz.remove());
|
||||
});
|
||||
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function(){
|
||||
$('#authorCreatDe').val(setDateTimeFmt('<c:out value="${authorInfoVO.authorCreatDe}"/>'));
|
||||
});
|
||||
|
||||
</script>
|
@ -1,180 +1,142 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
|
||||
<c:set var="registerFlag" value="${empty groupManageVO.groupId ? 'INSERT' : 'UPDATE'}"/>
|
||||
<c:set var="registerFlagName" value="${empty groupManageVO.groupId ? '그룹 등록' : '그룹 수정'}"/>
|
||||
<!-- 검색 필드 박스 시작 -->
|
||||
|
||||
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
|
||||
<validator:javascript formName="groupManage" staticJavascript="false" xhtml="true" cdata="false"/>
|
||||
<form:form commandName="groupManage" method="post" >
|
||||
<form>
|
||||
<c:set var="isUpdate" value="${!empty groupManage.groupId}"/>
|
||||
<c:set var="bizName" value="권한그룹"/>
|
||||
<c:out value='${isUpdate}'/>
|
||||
|
||||
<div class="popup" style="min-width: 400px;">
|
||||
<div class="popup_inner" style="max-width: 400px;">
|
||||
<p class="pop_title">권한 등록</p>
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-title.jsp"%>
|
||||
<table class="tbl03">
|
||||
<caption>권한 등록</caption>
|
||||
<tr>
|
||||
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 ID</th>
|
||||
<td nowrap="nowrap"><input name="groupId" id="groupId" type="text" readonly="readonly" value="<c:out value='${groupManage.groupId}'/>" size="40" title="그룹 ID" /></td>
|
||||
<caption>
|
||||
<c:out value="${bizName}"/> <spring:message code="title.update"/> / <spring:message code="title.create"/>
|
||||
</caption>
|
||||
<colgroup>
|
||||
<col style="width: 25%;"/>
|
||||
<col/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한그룹 ID</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<c:choose>
|
||||
<c:when test="${isUpdate}">
|
||||
<input name="groupId" id="groupId" type="text" readonly value="<c:out value='${groupManage.groupId}'/>" size="40" title="권한그룹ID" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input name="groupId" id="groupId" type="text" size="40" title="권한그룹ID" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="25%" scope="row" nowrap="nowrap">그룹 명
|
||||
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
|
||||
<th class="required" scope="row" nowrap="nowrap">
|
||||
<label>권한그룹 명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap"><input name="groupNm" id="groupNm" type="text" value="<c:out value='${groupManage.groupNm}'/>" maxLength="50" size="40" title="그룹명" /> <form:errors path="groupNm" /></td>
|
||||
<td nowrap="nowrap">
|
||||
<input name="groupNm" id="groupNm" type="text" value="<c:out value='${groupManage.groupNm}'/>" maxLength="50" size="40" title="권한그룹명" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th>
|
||||
<td nowrap="nowrap"><input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" /></td>
|
||||
<tr>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>권한</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<code:select type="AUTHOR" id="authorCode" name="authorCode" defaultSelect="${groupManage.authorCode}" title="권한" cls="selectBox" alt="selectBox tag"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">권한</th>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>설명</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<select id="authorCode" name="authorCode">
|
||||
<option value="">== 선택하세요 ==</option>
|
||||
<c:forEach var="row" items="${listAuthorInfoVO }">
|
||||
<option value="<c:out value="${row.author_code }"/>" <c:if test="${row.author_code eq groupManage.authorCode}">selected="selected"</c:if> ><c:out value="${row.author_nm }"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
<input name="groupDc" id="groupDc" type="text" value="<c:out value='${groupManage.groupDc}'/>" maxLength="50" size="50" title="설명" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</th>
|
||||
<td nowrap="nowrap"><input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${groupManage.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/></td>
|
||||
<th scope="row" nowrap="nowrap">
|
||||
<label>등록일자</label>
|
||||
</th>
|
||||
<td nowrap="nowrap">
|
||||
<input name="groupCreatDe" id="groupCreatDe" type="text" value="<c:out value='${groupManage.groupCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="popup_btn">
|
||||
<span class="flr" colspan="4">
|
||||
<c:if test="${registerFlag == 'INSERT'}">
|
||||
<a href="#LINK" class="btn blue" id="btnSave">저장</a>
|
||||
</c:if>
|
||||
<c:if test="${registerFlag == 'UPDATE'}">
|
||||
<a href="#LINK" class="btn blue" id="update_btn">변경</a>
|
||||
<a href="#LINK" class="btn red" id="delete_btn">삭제</a>
|
||||
</c:if>
|
||||
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- //등록버튼 -->
|
||||
<%@include file="/WEB-INF/jsp/framework/biz-popup-btn.jsp"%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
<!-- 검색조건 유지 -->
|
||||
<c:if test="${registerFlag == 'UPDATE'}">
|
||||
<input type="hidden" name="searchCondition" value="<c:out value='${groupManageSearchVO.searchCondition}'/>"/>
|
||||
<input type="hidden" name="searchKeyword" value="<c:out value='${groupManageSearchVO.searchKeyword}'/>"/>
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${groupManageSearchVO.pageIndex}'/>"/>
|
||||
</c:if>
|
||||
</form:form>
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javaScript">
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
|
||||
$(document).ready(function(){
|
||||
XitAuthGrpMng_edit.init();
|
||||
});
|
||||
/* *******************************
|
||||
* 사용자그룹관리 수정 Functions
|
||||
******************************* */
|
||||
var XitAuthGrpMng_edit = {
|
||||
init : function(){
|
||||
//닫기 버튼 Event
|
||||
$("#btnClose").click(function() {
|
||||
window.close();
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
add: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('add', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/addAuthGrp.do"/>'
|
||||
,data: $("form").serialize()
|
||||
//,contentType: 'x-www-form-url-encoded'
|
||||
})
|
||||
}
|
||||
|
||||
,modify: () => {
|
||||
if(!fnBiz.validate()) return;
|
||||
|
||||
cmmBizAjax('modify', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/modifyAuthGrp.do"/>'
|
||||
,data: $("form").serialize()
|
||||
});
|
||||
//저장 버튼 Event 설정
|
||||
$('#btnSave').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.addData();
|
||||
}
|
||||
});
|
||||
$('#update_btn').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.modifyData();
|
||||
}
|
||||
});
|
||||
$('#delete_btn').on({
|
||||
click: function(){
|
||||
XitAuthGrpMng_edit.removeData();
|
||||
}
|
||||
});
|
||||
$(".popup").css("position","absolute");
|
||||
$(".content_header").css("display","none");
|
||||
$("#cur_loc").css("display","none");
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 등록
|
||||
======================== */
|
||||
addData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("저장 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_insert_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 수정
|
||||
======================== */
|
||||
,modifyData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("수정 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_update_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
, remove: () => {
|
||||
cmmBizAjax('remove', {
|
||||
url: '<c:url value="/framework/biz/mng/auth/removeAuthGrp.do"/>'
|
||||
,data: {groupId: $('#groupId').val()}
|
||||
});
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 삭제
|
||||
======================== */
|
||||
,removeData : function(){
|
||||
var varFrom = document.getElementById("groupManage");
|
||||
if(confirm("삭제 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthGrpMng_delete_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthGrpMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
,validate: () => {
|
||||
if($('#groupId').val() === ''){
|
||||
alert('[권한그룹 ID]는 필수 입니다.');
|
||||
$('#authorCode').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#groupNm').val() === ''){
|
||||
alert('[권한그룹 명]은 필수 입니다.');
|
||||
$('#authorNm').focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnRegist').on('click', () => fnBiz.add());
|
||||
|
||||
$('#btnModify').on('click', () => fnBiz.modify());
|
||||
|
||||
$('#btnRemove').on('click', () => fnBiz.remove());
|
||||
});
|
||||
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function(){
|
||||
$('#groupCreatDe').val(setDateTimeFmt('<c:out value="${groupManage.groupCreatDe}"/>'));
|
||||
});
|
||||
</script>
|
||||
|
@ -0,0 +1,186 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
|
||||
<form id="frmSearch" name="frmSearch">
|
||||
<div class="search r2">
|
||||
|
||||
<table>
|
||||
<caption>검색조건</caption>
|
||||
<colgroup>
|
||||
<col style="width: 8%;"/>
|
||||
<col style="width: 20%;"/>
|
||||
<col style="width: 8%;"/>
|
||||
<col/>
|
||||
<col style="width: 8%;"/>
|
||||
<col/>
|
||||
<col style="width: 7%;"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<th>권한명</th>
|
||||
<td>
|
||||
<input id="searchKeyword" name="searchKeyword" type="text" value="<c:out value='${searchVO.searchKeyword}'/>" size="25" title="검색" onkeypress="XitAuthHierarchyMng_list.press();" />
|
||||
</td>
|
||||
<td colspan="6">
|
||||
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form> <!-- //검색 -->
|
||||
|
||||
<%--
|
||||
<div class="page_btn">
|
||||
<span class="flr">
|
||||
<a href="#" class="btn darkgray" id="btnPopup" title="권한계층설정">권한계층설정</a>
|
||||
</span>
|
||||
</div>
|
||||
--%>
|
||||
|
||||
<!-- //버튼 및 페이지정보 -->
|
||||
|
||||
<!-- 데이터 출력 -->
|
||||
<div id="grid"></div>
|
||||
|
||||
|
||||
<script type="text/javaScript">
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
let GRID = null;
|
||||
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
search: () => {
|
||||
GRID.reloadData();
|
||||
}
|
||||
,add: () => {
|
||||
const arrChecks = GRID.getCheckedRows();
|
||||
|
||||
if(arrChecks.length==0) {
|
||||
alert("등록[변경]할 목록을 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const data = {
|
||||
authorCode: $('#authorCode').val()
|
||||
,grantData: arrChecks.map((row) => {
|
||||
return {roleCode: row.roleCode, regYn: row.regYn}
|
||||
})
|
||||
}
|
||||
|
||||
if(confirm("등록 하시겠습니까?")) {
|
||||
cmmAjax({
|
||||
url: '<c:url value="/framework/biz/mng/auth/saveAuthRoleGrantList.do"/>'
|
||||
,data: JSON.stringify(data)
|
||||
,contentType: 'application/json; charset=utf-8'
|
||||
,success: () => {
|
||||
fnBiz.search();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
,onClickGrid: function(props){
|
||||
const rowData = props.grid.getRow(props.rowKey);
|
||||
fnBiz.pagePopup('add', rowData);
|
||||
}
|
||||
,pagePopup: function(flag, params){
|
||||
let url = '<c:url value="/framework/biz/mng/auth/mngAuthHierarchyMgtPopup.do"/>';
|
||||
let popTitle;
|
||||
let popOption = {width: 955, height:500}
|
||||
switch (flag) {
|
||||
case "add": //등록
|
||||
popTitle = "권한 계층 설정";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CmmPopup.open(url, params, popOption, popTitle);
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnSearch').on('click', () => fnBiz.search());
|
||||
|
||||
// $('#btnPopup').on('click', () => {
|
||||
// fnBiz.pagePopup('add', {});
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
/* *******************************
|
||||
* Grid
|
||||
******************************* */
|
||||
const initGrid = () => {
|
||||
const gridColumns = [
|
||||
{
|
||||
header: '권한코드',
|
||||
name: 'authorCode',
|
||||
width: 200,
|
||||
sortable: true,
|
||||
sortingType: 'desc',
|
||||
align: 'left',
|
||||
renderer: {
|
||||
type: CustomButtonRenderer,
|
||||
options: {
|
||||
formatter : function(props){
|
||||
const rowData = props.grid.getRow(props.rowKey);
|
||||
return {
|
||||
formatter: rowData.authorCode
|
||||
,element: "text"
|
||||
}
|
||||
}
|
||||
,eventFunction: fnBiz.onClickGrid //function(props){XitAuthGrpMng_list.fnClickGrpBtn(props )} //function(){alert("1234")}
|
||||
,eventType : "click"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
header: '권한 명',
|
||||
name: 'authorNm',
|
||||
width:200,
|
||||
sortable: false,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
header: '권한(role) 상속 구조',
|
||||
name: 'authorRescueCodeNm',
|
||||
minWidth: 200,
|
||||
sortable: true,
|
||||
align: 'left'
|
||||
}
|
||||
];
|
||||
|
||||
const gridOptions = {
|
||||
el: 'grid',
|
||||
rowHeaders: ['rowNum'],
|
||||
columns: gridColumns
|
||||
};
|
||||
|
||||
const gridDatasource = { //DataSource
|
||||
//initialRequest: true, // 화면 load시 조회 안함 - default
|
||||
api: {
|
||||
readData: {
|
||||
url: '<c:url value="/framework/biz/mng/auth/findAuthHierarchies.do"/>'
|
||||
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GRID = TuiGrid.of(gridOptions, gridDatasource, (res) => {
|
||||
console.log('~~~~~~~~~~')
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function(){
|
||||
console.log('~~~~~~~~~~~>>>>>>>>>')
|
||||
initGrid();
|
||||
});
|
||||
</script>
|
@ -1,245 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
|
||||
<form:form id="listForm" name="listForm" action="" method="post">
|
||||
<input type="hidden" name="authorCode"/>
|
||||
<input type="hidden" name="authorCodes"/>
|
||||
<input type="hidden" name="pageIndex" value="<c:out value='${searchVO.pageIndex}'/>"/>
|
||||
<input type="hidden" id="searchGubun" name="searchGubun" value="excel">
|
||||
<input type="hidden" name="searchCondition"/>
|
||||
<div class="search r2">
|
||||
|
||||
<table>
|
||||
<caption>검색조건</caption>
|
||||
<colgroup>
|
||||
<col style="width: 8%;"/>
|
||||
<col style="width: 20%;"/>
|
||||
<col style="width: 8%;"/>
|
||||
<col style="width: ;"/>
|
||||
<col style="width: 8%;"/>
|
||||
<col style="width: ;"/>
|
||||
<col style="width: 7%;"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<th>권한 명</th>
|
||||
<td>
|
||||
<input id="searchKeyword" name="searchKeyword" type="text" value="<c:out value='${searchVO.searchKeyword}'/>" size="25" title="검색" onkeypress="XitAuthHierarchyMng_list.press();" />
|
||||
</td>
|
||||
<td colspan="6">
|
||||
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
|
||||
</td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- //검색 -->
|
||||
|
||||
<div class="page_btn">
|
||||
<span class="fll">
|
||||
<a href="#" class="btn darkgray" id="btnSave" title="권한계층 설정">권한계층 설정</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- //버튼 및 페이지정보 -->
|
||||
|
||||
<!-- 데이터 출력 -->
|
||||
<div id="grid"></div>
|
||||
</form:form>
|
||||
|
||||
<script type="text/javaScript" language="javascript" defer="defer">
|
||||
$(document).ready(function(){
|
||||
XitAuthHierarchyMng_list.init();
|
||||
});
|
||||
/* *******************************
|
||||
* 권한계층관리 Functions
|
||||
******************************* */
|
||||
var XitAuthHierarchyMng_list = {
|
||||
init : function(){
|
||||
/**
|
||||
* Grid Config Settings
|
||||
*/
|
||||
//Grid Style Set
|
||||
Grid.applyTheme('striped'); // Call API of static method
|
||||
//Grid 체크박스 checked EventListner
|
||||
instance.on('check', function(ev) {
|
||||
// console.log('check!', ev);
|
||||
});
|
||||
//Grid 체크박스 unchecked EventListner
|
||||
instance.on('uncheck', function(ev) {
|
||||
// console.log('uncheck!', ev);
|
||||
});
|
||||
//Grid 체크박스 focus이동 EventListner
|
||||
instance.on('focusChange', function(ev) {
|
||||
// console.log('change focused cell!', ev);
|
||||
});
|
||||
|
||||
/**
|
||||
* Elements EventListener Settings
|
||||
*/
|
||||
//검색 Event 설정
|
||||
$('#btnSearch').on({
|
||||
click: function(){
|
||||
XitAuthHierarchyMng_list.findData();
|
||||
}
|
||||
});
|
||||
//권한계층 설정 버튼 Event
|
||||
$("#btnSave").click(function(){
|
||||
var params = "";
|
||||
XitAuthHierarchyMng_list.pagePopup('edit', "<c:url value='/framework/biz/mng/auth/AuthHierarchyMng_edit.do'/>", params);
|
||||
});
|
||||
|
||||
},
|
||||
press : function(){
|
||||
if(event.keyCode==13){
|
||||
fncSelectAuthorList('1');
|
||||
}
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 조회
|
||||
======================== */
|
||||
findData : function(){
|
||||
instance.reloadData();
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 등록
|
||||
======================== */
|
||||
addData : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 수정
|
||||
======================== */
|
||||
modifyData : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 삭제
|
||||
======================== */
|
||||
removeData : function(){
|
||||
},
|
||||
/* ========================
|
||||
* 페이지 이동
|
||||
-외부사이트 링크가 필요 시 사용(내부코드는 각 페이지에 맞게 수정, ex>https://www.gov.kr/portal/main )
|
||||
======================== */
|
||||
pageLink: function(flag, url, params){
|
||||
switch (flag) {
|
||||
case "move": //페이지 이동
|
||||
document.listForm.searchKeyword.value = "";
|
||||
document.listForm.action = url;
|
||||
document.listForm.submit();
|
||||
break;
|
||||
case "popup": //팝업 OPEN
|
||||
XitAuthHierarchyMng_list.pagePopup(flag, url, params);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/* ========================
|
||||
* 페이지 Open
|
||||
-팝업페이지를 Open 한다.
|
||||
======================== */
|
||||
pagePopup: function(flag, url, params){
|
||||
var popUrl = url;
|
||||
popUrl += "?tilesDef=popup";
|
||||
if(!(params == undefined || params == null)){
|
||||
popUrl += "&";
|
||||
popUrl += params;
|
||||
}
|
||||
var popTitle = '';
|
||||
switch (flag) {
|
||||
case "edit": //수정
|
||||
popTitle = "권한계층 설정";
|
||||
popOption = "scrollbars = yes, top=100px, left=100px, height=500px, width=955px;";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
window.open(popUrl, popTitle ,popOption);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* ******************************
|
||||
* Grid 환경 설정
|
||||
****************************** */
|
||||
var GridConfig = new XitTuiGridConfig();
|
||||
GridConfig.setOptGridId('grid'); //Grid를 출력할 Element ID(해당 Element에 Grid가 출력 됨)
|
||||
GridConfig.setOptGridHeight(270); //Grid 높이(단위: px)
|
||||
GridConfig.setOptRowHeight(20); //Grid row 높이(단위: px)
|
||||
GridConfig.setOptRowHeaderType('rowNum'); //Row 첫번째 Cell 타입(rowNum: 순번, checkbox: 체크박스, '': 아무것도 출력 안함)
|
||||
GridConfig.setOptPageOptions({ //페이징(Pagination) 옵션
|
||||
useClient: true //Client Paging 여부(true 설정 시 클라이언트 자체 페이징 처리. 서버호출 X)
|
||||
,perPage: 10 //페이지당 표시 건수
|
||||
});
|
||||
GridConfig.setOptColumnOptions({ //컬럼고정 옵션
|
||||
});
|
||||
GridConfig.setOptDataSource({ //DataSource
|
||||
/* -----------------------
|
||||
* DataSource Config Setting
|
||||
* -설정항목은 Global 적용 되며
|
||||
* -API별 적용을 원할 경우 각 API 안에 작성 가능(우선순위: 개별->글로벌)
|
||||
----------------------- */
|
||||
//contentType: 'application/json',
|
||||
//headers: { 'x-custom-header': 'custom-header' },
|
||||
initialRequest: true, //디폴트 값은 true(false: 인스턴스 생성 시 요청은 보내지 않음. 이런 경우 "instance.reloadData()"를 사용하여 요청 가능)
|
||||
//serializer: function(params) {
|
||||
//return $(document.listForm).serialize();
|
||||
// },
|
||||
/* -----------------------
|
||||
* DataSource API Setting
|
||||
----------------------- */
|
||||
api: {
|
||||
readData : {
|
||||
url: '<c:url value="/framework/biz/mng/auth/AuthHierarchyMng_list.ajax"/>', method: 'GET'
|
||||
,initParams: {}
|
||||
,serializer: function(params) {
|
||||
var form = document.listForm;
|
||||
var serializeParam = $(form).serialize();
|
||||
for(var key in params){
|
||||
if(key=='perPage'){
|
||||
if(params[key]==undefined)
|
||||
serializeParam +='&'+key+'=-1';
|
||||
else
|
||||
serializeParam +='&'+key+'='+params[key];
|
||||
}else
|
||||
serializeParam +='&'+key+'='+params[key];
|
||||
}
|
||||
return serializeParam;
|
||||
}
|
||||
}
|
||||
,createData: { url: '', method: 'POST'}
|
||||
,updateData: { url: '', method: 'PUT'}
|
||||
,modifyData: { url: '', method: 'PUT'}
|
||||
,deleteData: { url: '', method: 'DELETE'}
|
||||
}
|
||||
});
|
||||
GridConfig.setOptHeader({
|
||||
}); //Grid 헤더 정보(헤더 셀 병합 필요 시 설정)
|
||||
GridConfig.setOptColumns([ //Grid 컬럼 정보(명칭,매핑 field, 기타옵션 등)
|
||||
{
|
||||
header: '권한코드',
|
||||
name: 'authorCode',
|
||||
width: 200,
|
||||
sortable: true,
|
||||
sortingType: 'desc',
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
header: '권한 명',
|
||||
name: 'authorNm',
|
||||
width:200,
|
||||
sortable: false,
|
||||
align: 'left'
|
||||
},
|
||||
{
|
||||
header: '권한(role) 상속 구조',
|
||||
name: 'authorRescueCodeNm',
|
||||
minWidth: 200,
|
||||
sortable: true,
|
||||
align: 'left'
|
||||
}
|
||||
]);
|
||||
var Grid = tui.Grid;
|
||||
var instance = GridConfig.instance(Grid); //Grid 인스턴스
|
||||
</script>
|
@ -1,171 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %>
|
||||
|
||||
|
||||
<c:set var="registerFlag" value="${empty authorManageVO.authorCode ? 'INSERT' : 'UPDATE'}"/>
|
||||
<c:set var="registerFlagName" value="${empty authorManageVO.authorCode ? '권한 등록' : '권한 수정'}"/>
|
||||
<!-- 검색 필드 박스 시작 -->
|
||||
|
||||
<script type="text/javascript" src="<c:url value="/framework/util/validator.do"/>"></script>
|
||||
<validator:javascript formName="authorManage" staticJavascript="false" xhtml="true" cdata="false"/>
|
||||
<form:form commandName="authorManage" method="post" >
|
||||
|
||||
<div class="popup" style="min-width: 400px;">
|
||||
<div class="popup_inner" style="max-width: 400px;">
|
||||
<p class="pop_title">권한 등록</p>
|
||||
<table class="tbl03">
|
||||
<caption>권한 등록</caption>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">권한 코드
|
||||
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
|
||||
</th>
|
||||
<td nowrap="nowrap"><input name="authorCode" id="authorCode" type="text" value="<c:out value='${authorManage.authorCode}'/>" size="40" title="권한코드" /> <form:errors path="authorCode" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">권한 명
|
||||
<img src="<c:url value='/'/>resourcesimages/required.gif" width="15" height="15" alt="필수" />
|
||||
</th>
|
||||
<td nowrap="nowrap"><input name="authorNm" id="authorNm" type="text" value="<c:out value='${authorManage.authorNm}'/>" maxLength="50" size="40" title="권한명" /> <form:errors path="authorNm" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">설명</th>
|
||||
<td nowrap="nowrap"><input name="authorDc" id="authorDc" type="text" value="<c:out value='${authorManage.authorDc}'/>" maxLength="50" size="50" title="설명" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="required" width="20%" scope="row" nowrap="nowrap">등록일자</th>
|
||||
<td nowrap="nowrap"><input name="authorCreatDe" id="authorCreatDe" type="text" value="<c:out value='${authorManage.authorCreatDe}'/>" maxLength="50" size="20" readonly="readonly" title="등록일자"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="popup_btn">
|
||||
<span class="flr" colspan="4">
|
||||
<c:if test="${registerFlag == 'INSERT'}">
|
||||
<a href="#LINK" class="btn blue" id="btnSave">저장</a>
|
||||
</c:if>
|
||||
<c:if test="${registerFlag == 'UPDATE'}">
|
||||
<a href="#LINK" class="btn blue" id="update_btn">변경</a>
|
||||
<a href="#LINK" class="btn red" id="delete_btn">삭제</a>
|
||||
</c:if>
|
||||
<a href="#" class="btn lightgray" id="btnClose">닫기</a>
|
||||
</span>
|
||||
</div>
|
||||
<!-- //등록버튼 -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- //popup -->
|
||||
</form:form>
|
||||
|
||||
|
||||
<script type="text/javaScript">
|
||||
|
||||
$(document).ready(function(){
|
||||
XitAuthRegMng_edit.init();
|
||||
});
|
||||
/* *******************************
|
||||
* 권한관리 수정화면 Functions
|
||||
******************************* */
|
||||
var XitAuthRegMng_edit = {
|
||||
init : function(){
|
||||
//닫기 버튼 Event
|
||||
$("#btnClose").click(function() {
|
||||
window.close();
|
||||
});
|
||||
//저장 버튼 Event 설정
|
||||
$('#btnSave').on({
|
||||
click: function(){
|
||||
XitAuthRegMng_edit.addData();
|
||||
}
|
||||
});
|
||||
$('#update_btn').on({
|
||||
click: function(){
|
||||
XitAuthRegMng_edit.modifyData();
|
||||
}
|
||||
});
|
||||
$('#delete_btn').on({
|
||||
click: function(){
|
||||
XitAuthRegMng_edit.removeData();
|
||||
}
|
||||
});
|
||||
$(".popup").css("position","absolute");
|
||||
$(".content_header").css("display","none");
|
||||
$("#cur_loc").css("display","none");
|
||||
},
|
||||
/* ========================
|
||||
* 데이터 등록
|
||||
======================== */
|
||||
addData : function(){
|
||||
if(!validateAuthorManage(document.getElementById("authorManage")))
|
||||
return;
|
||||
|
||||
var varFrom = document.getElementById("authorManage");
|
||||
if(confirm("저장 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthRegMng_insert_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthRegMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 수정
|
||||
======================== */
|
||||
,modifyData : function(){
|
||||
if(!validateAuthorManage(document.getElementById("authorManage")))
|
||||
return;
|
||||
|
||||
var varFrom = document.getElementById("authorManage");
|
||||
if(confirm("수정 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthRegMng_update_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthRegMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/* ========================
|
||||
* 데이터 삭제
|
||||
======================== */
|
||||
,removeData : function(){
|
||||
var varFrom = document.getElementById("authorManage");
|
||||
if(confirm("삭제 하시겠습니까?")){
|
||||
var param = $(varFrom).serialize();
|
||||
$.ajax({
|
||||
url : "/framework/biz/mng/auth/AuthRegMng_delete_proc.do",
|
||||
data : param,
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.resp.message);
|
||||
window.opener.XitAuthRegMng_list.findData();
|
||||
window.close();
|
||||
},
|
||||
error: function(){
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
@ -0,0 +1,253 @@
|
||||
<%@ page import="org.json.simple.JSONObject" %>
|
||||
<%@ page import="org.json.simple.JSONArray" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/framework/taglibs.jsp" %>
|
||||
|
||||
<title>권한별 롤 목록</title>
|
||||
<div class="popup" style="min-width: 400px;">
|
||||
<div class="popup_inner">
|
||||
<p class="pop_title">권한별 롤 목록</p>
|
||||
|
||||
<form name="frmSearch" id="frmSearch">
|
||||
<div class="search r2">
|
||||
<table>
|
||||
<caption>검색조건</caption>
|
||||
<colgroup>
|
||||
<col style="width: 8%;"/>
|
||||
<col style="width: 20%;"/>
|
||||
<col style="width: 8%;"/>
|
||||
<col/>
|
||||
<col style="width: 8%;"/>
|
||||
<col/>
|
||||
<col style="width: 7%;"/>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>권한코드 : </th>
|
||||
<td colspan="6">
|
||||
<input id="authorCode" name="authorCode" type="text" size="30" value="<c:out value='${authorRoleManageVO.roleCode}'/>" title="검색" readonly="readonly" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="button" id="btnSearch" class="btn_search" title="검색" value="검색" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 데이터 출력 -->
|
||||
<div id="grid"></div>
|
||||
<div class="popup_btn">
|
||||
<span class="fll">
|
||||
<div class="list clearfix" id="totCnt">전체 ㅣ <span></span></div>
|
||||
</span>
|
||||
<span class="flr">
|
||||
<a href="#" class="btn blue" id="btnRegist" title="저장">저장</a>
|
||||
<a href="#" class="btn lightgray" onclick="window.close()">닫기</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
/**************************************************************************
|
||||
* Global Variable
|
||||
**************************************************************************/
|
||||
let GRID = null;
|
||||
|
||||
/* *******************************
|
||||
* Biz function
|
||||
******************************* */
|
||||
const fnBiz = {
|
||||
search: () => {
|
||||
GRID.reloadData();
|
||||
//TODO : onGridUpdated
|
||||
GRID.on('onGridUpdated', (ev) => {
|
||||
console.log('%%%%%%%%%%%%%>>>>>>>',ev)
|
||||
}) // 그리드 레이아웃 새로고침 (로드가 다 되지 않는 경우 그리드가 흰색 화면으로 출력될 때가 있다.))
|
||||
}
|
||||
,add: () => {
|
||||
const arrChecks = GRID.getCheckedRows();
|
||||
|
||||
if(arrChecks.length==0) {
|
||||
alert("등록[변경]할 목록을 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
const data = {
|
||||
authorCode: $('#authorCode').val()
|
||||
,grantData: arrChecks.map((row) => {
|
||||
return {roleCode: row.roleCode, regYn: row.regYn}
|
||||
})
|
||||
}
|
||||
|
||||
if(confirm("등록 하시겠습니까?")) {
|
||||
cmmAjax({
|
||||
url: '<c:url value="/framework/biz/mng/auth/saveAuthRoleGrantList.do"/>'
|
||||
,data: JSON.stringify(data)
|
||||
,contentType: 'application/json; charset=utf-8'
|
||||
,success: () => {
|
||||
fnBiz.search();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* event
|
||||
**************************************************************************/
|
||||
$(() => {
|
||||
$('#btnSearch').on('click', () => fnBiz.search());
|
||||
|
||||
$('#btnRegist').on('click', () => {
|
||||
fnBiz.add();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/* *******************************
|
||||
* Grid
|
||||
******************************* */
|
||||
const initGrid = () => {
|
||||
const gridColumns = [
|
||||
{
|
||||
header: '롤 ID',
|
||||
name: 'roleCode',
|
||||
width: 150,
|
||||
sortingType: 'asc',
|
||||
sortable: true,
|
||||
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 설정방법은 상이하므로 사이트 참조)
|
||||
// filter: { type: 'text', showApplyBtn: true, showClearBtn: true },
|
||||
},
|
||||
{
|
||||
header: '롤 명',
|
||||
name: 'roleNm',
|
||||
width: 150,
|
||||
sortingType: 'desc',
|
||||
sortable: true,
|
||||
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 설정방법은 상이하므로 사이트 참조)
|
||||
},
|
||||
{
|
||||
header: '등록여부',
|
||||
headerCellClass: 'blue',
|
||||
name: 'regYn',
|
||||
width: 60,
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
filter: 'select',
|
||||
/* 에디터 적용 */
|
||||
formatter: 'listItemText',
|
||||
editor: {
|
||||
type: 'radio', //select, radio, checkbox, text
|
||||
options: {
|
||||
listItems: [
|
||||
<c:forEach var="row" items="${regYnList}" varStatus="status">
|
||||
<c:if test="${not status.first}">,</c:if>
|
||||
{
|
||||
text: '${row.code_nm}'
|
||||
,value: '${row.code}'
|
||||
}
|
||||
</c:forEach>
|
||||
]
|
||||
}
|
||||
},
|
||||
//TODO : 컬럼 스타일 : README.md 참조
|
||||
renderer: {
|
||||
styles: {
|
||||
background: (props) => props.value === 'Y' ? 'cyan' : 'red'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
header: '롤 패턴',
|
||||
name: 'rolePttrn',
|
||||
minWidth: 150,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
header: '롤 설명',
|
||||
name: 'roleDc',
|
||||
minWidth: 150,
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
header: '롤 타입',
|
||||
name: 'roleTy',
|
||||
width: 50,
|
||||
sortingType: 'desc',
|
||||
sortable: true,
|
||||
align: 'center',
|
||||
filter: 'select' //fiter 옵션(select/text/number/date/.. 등이 있으며 text/date 설정방법은 상이하므로 사이트 참조)
|
||||
},
|
||||
{
|
||||
header: '정렬순서',
|
||||
name: 'roleSort',
|
||||
width: 50,
|
||||
sortable: true,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
header: '등록일시',
|
||||
name: 'creatDt',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
formatter({value}){
|
||||
return setDateTimeFmt(value);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
const gridOptions = {
|
||||
el: 'grid',
|
||||
rowHeaders: ['rowNum', 'checkbox'],
|
||||
columns: gridColumns,
|
||||
//TODO : 페이징 미사용시
|
||||
//페이지처리 hide
|
||||
pagination: false,
|
||||
pageOptions: null,
|
||||
// pageOptions: {
|
||||
// useClient: true,
|
||||
// perPage: 100
|
||||
// },
|
||||
columnOptions: {
|
||||
frozenCount: 3
|
||||
},
|
||||
bodyHeight: 400,
|
||||
onGridMounted: (ev)=>{
|
||||
console.log('mounted~~~~~~~~',ev)
|
||||
}
|
||||
};
|
||||
|
||||
const gridDatasource = { //DataSource
|
||||
initialRequest: true, // 화면 load시 조회 안함 - default
|
||||
api: {
|
||||
readData: {
|
||||
url: '<c:url value="/framework/biz/mng/auth/findAuthRoleGrantList.do"/>'
|
||||
, initParams: {authorCode: $('#authorCode').val()}
|
||||
,serializer: (params) => fnAddPageInfo(document.frmSearch, params)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
GRID = TuiGrid.of(gridOptions, gridDatasource, (ev) => {
|
||||
console.table('---------->>>',ev)
|
||||
console.log('---------->>>',ev.instance)
|
||||
console.log('---------->>>',ev.responseData)
|
||||
});
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* initialize
|
||||
**************************************************************************/
|
||||
$(document).ready(function(){
|
||||
initGrid();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue