FAISP/src/main/resources/static/js/counterIntelligence/ciaForeigner.js

91 lines
2.4 KiB
JavaScript
Raw Normal View History

2023-01-04 08:54:59 +00:00
$(document).on('click', '#addBtn', function (){
getCiaForeignerEditModal(null);
})
function getCiaForeignerEditModal(ciKey){
$.ajax({
url: '/counterIntelligence/ciaForeignerEditModal',
data: {ciKey: ciKey},
type: 'GET',
dataType:"html",
success: function(html){
$("#ciaForeignerEditModalContent").empty().append(html);
$("#fixDate").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
setUploadDiv();
setEditor('editor', '400');
$("#ciaForeignerEditModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#saveBtn', function (){
if(confirm("저장하시겠습니까?")){
2023-01-05 02:42:12 +00:00
const formData = new FormData($("#ciaForeignerEditForm")[0]);
2023-01-04 08:54:59 +00:00
for(const file of files) {
if(!file.isDelete)
formData.append('uploadFiles', file, file.name);
}
$(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq"));
})
2023-01-05 02:42:12 +00:00
formData.append('monitoringInfo', CrossEditor.GetBodyValue());
2023-01-04 08:54:59 +00:00
$.ajax({
type : 'POST',
data : formData,
url : "/counterIntelligence/saveCiActivity",
processData: false,
contentType: false,
success : function(result) {
alert("저장되었습니다.");
contentFade("out");
location.reload();
},
error : function(xhr, status) {
alert("저장에 실패하였습니다.")
contentFade("out");
}
})
}
})
2023-01-05 09:00:37 +00:00
$(document).on('click', '.fiTr', function (){
getCiaForeignerViewModal($(this).find(".ciKey").val());
2023-01-04 08:54:59 +00:00
})
2023-01-05 09:00:37 +00:00
function getCiaForeignerViewModal(ciKey){
2023-01-04 08:54:59 +00:00
$.ajax({
2023-01-05 09:00:37 +00:00
url: '/counterIntelligence/ciaForeignerViewModal',
2023-01-04 08:54:59 +00:00
data: {ciKey: ciKey},
type: 'GET',
dataType:"html",
success: function(html){
2023-01-05 09:00:37 +00:00
$("#ciaForeignerViewModalBody").empty().append(html)
$("#ciaForeignerViewModal").modal('show');
2023-01-04 08:54:59 +00:00
},
error:function(){
}
});
}
$(document).on('click', '#editBtn', function (){
2023-01-05 09:00:37 +00:00
$("#ciaForeignerViewModal").modal('hide');
getCiaForeignerEditModal($(this).attr("data-cikey"));
2023-01-04 08:54:59 +00:00
})
2023-01-05 09:00:37 +00:00
$(document).on('click', '#excelDown', function (){
exportExcel("외국인 커뮤니티 모니터링 현황","ciaForeignerTb");
})
function OnInitCompleted(e){
e.editorTarget.SetBodyValue(document.getElementById("monitoringInfo").value);
}