67 lines
1.9 KiB
JavaScript
67 lines
1.9 KiB
JavaScript
|
|
$(document).on('click', '.userInfoTr', function (){
|
|
$.ajax({
|
|
url: '/authMgt/authEditModal',
|
|
data: {userSeq: Number($(this).find(".userSeq").val())},
|
|
type: 'GET',
|
|
dataType:"html",
|
|
success: function(html){
|
|
$("#configInfo").empty().append(html)
|
|
$("#authEditModal").modal('show');
|
|
},
|
|
error:function(){
|
|
|
|
}
|
|
});
|
|
})
|
|
|
|
$(document).on('click', '.radioTd', function (){
|
|
$(this).find('input').prop('checked', true);
|
|
})
|
|
|
|
$(document).on('click', '#saveAuthBtn', function (){
|
|
if(confirm("저장하시겠습니까?")){
|
|
contentFade("in");
|
|
const userSeq = Number($("#userSeq").val());
|
|
const accessConfigList = []
|
|
$("#accessEditTable").find('tbody').children().each(function (idx, tr){
|
|
accessConfigList.push(
|
|
{
|
|
userSeq: userSeq,
|
|
menuKey: Number($(this).find('.menuKey').val()),
|
|
accessAuth: $(this).find('input:checked').val()
|
|
}
|
|
)
|
|
})
|
|
const approvalConfigList = []
|
|
$("#approvalEditTable").find('input:checked').each(function (idx, tr){
|
|
approvalConfigList.push(
|
|
{
|
|
userSeq: userSeq,
|
|
menuKey: Number($(this).parents('tbody').find('.menuKey').val()),
|
|
approvalAuth: $(this).val()
|
|
}
|
|
)
|
|
})
|
|
const authList = {};
|
|
authList.accessConfigList = accessConfigList;
|
|
authList.approvalConfigList = approvalConfigList;
|
|
$.ajax({
|
|
type : 'POST',
|
|
url : "/authMgt/saveAuth",
|
|
data : JSON.stringify(authList),
|
|
contentType: 'application/json',
|
|
beforeSend: function (xhr){
|
|
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
|
|
},
|
|
success : function(data) {
|
|
alert("저장되었습니다.");
|
|
contentFade("out");
|
|
},
|
|
error : function(xhr, status) {
|
|
alert("저장에 실패하였습니다.")
|
|
contentFade("out");
|
|
}
|
|
})
|
|
}
|
|
}) |