2022-09-05 07:47:25 +00:00
|
|
|
$(document).on('click', '.userInfoTr', function (){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/translator/translatorEditModal',
|
|
|
|
|
data: {
|
|
|
|
|
translatorKey: Number($(this).find(".trKey").val()),
|
|
|
|
|
versionNo : Number($(this).find(".verNo").val())
|
|
|
|
|
},
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType:"html",
|
|
|
|
|
success: function(html){
|
|
|
|
|
$("#configInfo").empty().append(html)
|
|
|
|
|
$("#translatorEditModal").modal('show');
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
2022-09-05 04:53:49 +00:00
|
|
|
|
2022-09-05 07:47:25 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#updateBtn', function (){
|
|
|
|
|
if(confirm("수정하시겠습니까?")){
|
|
|
|
|
contentFade("in");
|
|
|
|
|
const formData = new FormData($("#trInfoUpdate")[0]);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'POST',
|
|
|
|
|
data : formData,
|
|
|
|
|
url : "/translator/updatetranslatorInfo",
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
success : function() {
|
|
|
|
|
alert("수정되었습니다.");
|
|
|
|
|
contentFade("out");
|
2022-09-06 08:40:44 +00:00
|
|
|
location.reload();
|
2022-09-05 07:47:25 +00:00
|
|
|
},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert("수정에 실패하였습니다.");
|
|
|
|
|
contentFade("out");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-09-05 04:53:49 +00:00
|
|
|
|
|
|
|
|
$(document).on('click', '#saveBtn', function (){
|
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
|
|
|
contentFade("in");
|
|
|
|
|
const formData = new FormData($("#translatorInsert")[0]);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'POST',
|
|
|
|
|
data : formData,
|
|
|
|
|
url : "/translator/insertTranslatorInfo",
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
success : function(result) {
|
2022-09-06 08:40:44 +00:00
|
|
|
alert("저장되었습니다.")
|
2022-09-05 04:53:49 +00:00
|
|
|
contentFade("out");
|
2022-09-06 08:40:44 +00:00
|
|
|
location.reload();
|
2022-09-05 04:53:49 +00:00
|
|
|
},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert("저장에 실패하였습니다.")
|
|
|
|
|
contentFade("out");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function valueCheck(form){
|
|
|
|
|
const targetForm = $("#"+form);
|
|
|
|
|
const userId = targetForm.find("#userId").val();
|
|
|
|
|
const password = targetForm.find("#modalPassword");
|
|
|
|
|
const passwordConfirm = targetForm.find("#passwordConfirm");
|
|
|
|
|
const userNm = targetForm.find("#userNm").val();
|
|
|
|
|
const ogCd = targetForm.find("#ogCd").val();
|
|
|
|
|
const ofcCd = targetForm.find("#ofcCd").val();
|
|
|
|
|
let returnFlag = true;
|
|
|
|
|
|
|
|
|
|
if(!userId){
|
|
|
|
|
alert("아이디를 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}else{
|
|
|
|
|
const idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
|
|
|
|
|
if(!idReg.test(userId)){
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
alert("아이디 조건이 맞지 않습니다.")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!password[0].disabled && !password.val()){
|
|
|
|
|
alert("비밀번호를 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!password[0].disabled && !passwordConfirm.val()){
|
|
|
|
|
alert("비밀번호 확인을 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!userNm){
|
|
|
|
|
alert("이름 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(returnFlag){
|
|
|
|
|
const passwordReg = /^(?=.*[a-zA-z])(?=.*[0-9])(?=.*[$`~!@$!%*#^?&\\(\\)\-_=+]).{8,16}$/;
|
|
|
|
|
if(!password[0].disabled){
|
|
|
|
|
if(!passwordReg.test(password.val())){
|
|
|
|
|
alert("비밀번호 조건이 맞지 않습니다.")
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}else{
|
|
|
|
|
if(password.val() !== passwordConfirm.val()){
|
|
|
|
|
alert("비밀번호가 같지 않습니다.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!ogCd){
|
|
|
|
|
alert("관서를 선택해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!ofcCd){
|
|
|
|
|
alert("부서를 선택해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
return returnFlag;
|
|
|
|
|
}
|