Merge branch 'features/ui-improvements' into jenkins_with_weblogic
This commit is contained in:
@@ -649,6 +649,10 @@ $(document).ready(function() {
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_modify").text("처리중 . . . . .");
|
||||
},
|
||||
success:function(args){
|
||||
if(args.status=="error"){
|
||||
alert("<%=localeMessage.getString("common.intizMsg")%>"+args.message);
|
||||
@@ -659,7 +663,11 @@ $(document).ready(function() {
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_modify").text("수정");
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#btn_clone,#btn_clone_new").click(function(){
|
||||
@@ -696,6 +704,10 @@ $(document).ready(function() {
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_clone").text("처리중 . . . . .");
|
||||
},
|
||||
success:function(args){
|
||||
alert("<%=localeMessage.getString("common.croneMsg")%>");
|
||||
//goNav(returnUrl);//LIST로 이동
|
||||
@@ -715,7 +727,11 @@ $(document).ready(function() {
|
||||
alert(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_clone").text("복제");
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#btn_delete").click(function(){
|
||||
@@ -726,6 +742,10 @@ $(document).ready(function() {
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_delete").text("처리중 . . . . .");
|
||||
},
|
||||
success:function(args){
|
||||
if(args.status=="error"){
|
||||
alert("<%=localeMessage.getString("common.intizMsg")%>"+args.message);
|
||||
@@ -736,7 +756,11 @@ $(document).ready(function() {
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_delete").text("삭제");
|
||||
}
|
||||
});
|
||||
}else{
|
||||
return false;
|
||||
|
||||
@@ -233,43 +233,129 @@
|
||||
window.alert('이관 대상 API 성공['+successCount+']건, 실패['+failedCount+']건 서버에 다운로드 완료');
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
buttonControl();
|
||||
|
||||
FilePond.registerPlugin(FilePondPluginFileValidateType);
|
||||
// FilePond 인스턴스 생성
|
||||
const pond = FilePond.create(document.querySelector('.filepond'), {
|
||||
instantUpload: false, // 파일을 즉시 업로드하지 않음
|
||||
allowRevert: false,
|
||||
acceptedFileTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/json'],
|
||||
// 서버 설정
|
||||
server: {
|
||||
process: {
|
||||
url: url_file + '?cmd=LIST_IMPORT_FILE&serviceType=' + sessionStorage["serviceType"],
|
||||
method: 'POST',
|
||||
// 필요한 경우 headers나 다른 설정 추가
|
||||
// 25.11.25 파일 가져오기 할 때 중복 검사 기능추가.
|
||||
FilePond.registerPlugin(FilePondPluginFileValidateType);
|
||||
|
||||
let uploadErrors = [];
|
||||
let processedCount = 0;
|
||||
let totalFiles = 0;
|
||||
|
||||
// FilePond 인스턴스 생성
|
||||
const pond = FilePond.create(document.querySelector('.filepond'), {
|
||||
instantUpload: false,
|
||||
allowRevert: false,
|
||||
acceptedFileTypes: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/json'],
|
||||
|
||||
// 서버 설정
|
||||
server: {
|
||||
process: {
|
||||
url: url_file + '?cmd=LIST_IMPORT_FILE&serviceType=' + sessionStorage["serviceType"],
|
||||
method: 'POST',
|
||||
ondata: (formData) => {
|
||||
const chkBox = document.querySelector('#uploadModal input[name="importDupliCheck"]');
|
||||
const isChecked = chkBox ? chkBox.checked : false;
|
||||
formData.append('importDupliCheck', isChecked);
|
||||
return formData;
|
||||
},
|
||||
// revert, load, restore, fetch 설정 (필요한 경우)
|
||||
},
|
||||
// 다른 필요한 옵션 추가
|
||||
});
|
||||
|
||||
pond.on('processfiles', () => {
|
||||
// 여기에 모든 파일 업로드 완료 후 실행할 코드를 작성
|
||||
console.debug('모든 파일의 처리가 완료되었습니다.');
|
||||
$('#btn_search').click();
|
||||
});
|
||||
|
||||
// "업로드 시작" 버튼 클릭 이벤트 핸들러
|
||||
document.getElementById('uploadButton').addEventListener('click', function () {
|
||||
pond.processFiles(); // 선택된 모든 파일을 업로드
|
||||
});
|
||||
|
||||
// 모달 닫기 이벤트 핸들러
|
||||
$('#uploadModal').on('hidden.bs.modal', function (e) {
|
||||
pond.removeFiles(); // 모달이 닫힐 때 파일 목록에서 모든 파일 제거
|
||||
});
|
||||
onerror: (response) => {
|
||||
return response;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 파일 처리 결과 수신
|
||||
pond.on('processfile', (error, file) => {
|
||||
processedCount++;
|
||||
|
||||
if (error) {
|
||||
let errorMsg = '';
|
||||
|
||||
if (error.body) {
|
||||
errorMsg = error.body;
|
||||
} else if (typeof error === 'string') {
|
||||
errorMsg = error;
|
||||
} else {
|
||||
errorMsg = '가져오기 중 오류가 발생 했습니다.';
|
||||
}
|
||||
|
||||
let fileName = 'UnKnown';
|
||||
if (file) {
|
||||
if(file.filename) fileName = file.filename;
|
||||
else if (file.file && file.file.name) fileName = file.file.name;
|
||||
}
|
||||
|
||||
uploadErrors.push('파일명 [ ' + fileName + '] \n MESSAGE : ' + errorMsg);
|
||||
}
|
||||
|
||||
// 모든 파일 처리 완료 시
|
||||
if (processedCount >= totalFiles) {
|
||||
setTimeout(() => {
|
||||
if (uploadErrors.length > 0) {
|
||||
const msg = "파일 처리 중 오류가 발생했습니다. \n" + uploadErrors.join('\n');
|
||||
|
||||
// 실패 시 변수 초기화
|
||||
uploadErrors = [];
|
||||
processedCount = 0;
|
||||
|
||||
$('#btn_search').click();
|
||||
alert(msg);
|
||||
|
||||
} else {
|
||||
alert('모든 파일이 성공적으로 업로드 되었습니다.');
|
||||
$('#uploadModal').modal('hide');
|
||||
$('#btn_search').click();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// 업로드 버튼 클릭 이벤트
|
||||
document.getElementById('uploadButton').addEventListener('click', function(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
uploadErrors = [];
|
||||
processedCount = 0;
|
||||
|
||||
const currentFiles = pond.getFiles();
|
||||
totalFiles = currentFiles.length;
|
||||
|
||||
if (totalFiles === 0) {
|
||||
alert("업로드 할 파일을 선택하세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
const chkBox = document.getElementById('importDupliCheck');
|
||||
|
||||
if (chkBox && !chkBox.checked) {
|
||||
if (!confirm("중복검사를 체크하지 않는 경우 기존 값은 덮어 씌워집니다. \n진행하시겠습니까?")) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
pond.processFiles();
|
||||
});
|
||||
|
||||
// 모달이 닫힐 때만 초기화
|
||||
$('#uploadModal').on('hidden.bs.modal', function(e) {
|
||||
resetPond();
|
||||
});
|
||||
|
||||
function resetPond() {
|
||||
pond.removeFiles();
|
||||
|
||||
const chkBox = document.getElementById('importDupliCheck');
|
||||
if (chkBox) chkBox.checked = false;
|
||||
|
||||
processedCount = 0;
|
||||
totalFiles = 0;
|
||||
uploadErrors = [];
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
@@ -329,6 +415,10 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- 파일 업로드 시 중복체크 -->
|
||||
|
||||
<input type="checkbox" id="importDupliCheck" name="importDupliCheck">
|
||||
<label class="form-check-label" for="importDupliCheck">중복검사</label>
|
||||
<input type="file" class="filepond" name="file" multiple data-allow-reorder="true"
|
||||
data-max-file-size="3MB" data-max-files="10">
|
||||
</div>
|
||||
|
||||
@@ -867,6 +867,10 @@
|
||||
type: "POST",
|
||||
url:url,
|
||||
data: postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_modify").text("처리중 . . . . .");
|
||||
},
|
||||
success:function(message){
|
||||
alert("저장 되었습니다. \n\n[실시간 반영 결과]\n"+JSON.stringify(message));
|
||||
if (typeof callback === 'function') {
|
||||
@@ -877,6 +881,10 @@
|
||||
},
|
||||
error:function(xhr, status, errorMsg){
|
||||
alert(JSON.parse(xhr.responseText).errorMsg);
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_modify").text("수정");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -936,6 +944,11 @@
|
||||
type : "POST",
|
||||
url:url,
|
||||
data:postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_delete").text("처리중 . . . . .");
|
||||
},
|
||||
|
||||
success:function(args){
|
||||
alert("삭제 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
@@ -943,6 +956,10 @@
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_delete").text("삭제");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1203,6 +1220,10 @@
|
||||
newInboundHttpMethod,
|
||||
newInboundRestPath,
|
||||
},
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#doCloneInterfaceButton").text("처리중 . . . . .");
|
||||
},
|
||||
success: function () {
|
||||
alert("["+orgApiInterfaceId+"] => ["+newBizCode+"]["+newApiInterfaceId+"] 복제 완료.");
|
||||
$('#cloneInterfaceModal').modal('hide');
|
||||
@@ -1210,19 +1231,25 @@
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
},
|
||||
complete: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#doCloneInterfaceButton").text("복제");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_excel_export").click(function () {
|
||||
const url = url_excel + '?cmd=DETAIL_EXPORT_TO_EXCEL';
|
||||
const params = new URLSearchParams();
|
||||
params.append('eaiSvcName', getFullSvcName());
|
||||
|
||||
downloadFiles(url, params);
|
||||
|
||||
return false;
|
||||
});
|
||||
// 25.11.25 엑셀다운로드 사용안함.
|
||||
// $("#btn_excel_export").click(function () {
|
||||
// const url = url_excel + '?cmd=DETAIL_EXPORT_TO_EXCEL';
|
||||
// const params = new URLSearchParams();
|
||||
// params.append('eaiSvcName', getFullSvcName());
|
||||
// downloadFiles(url, params);
|
||||
// return false;
|
||||
// });
|
||||
|
||||
|
||||
// JSON 다운로드
|
||||
$("#btn_json_export").click(function () {
|
||||
const uri = url + '?cmd=DETAIL_EXPORT_TO_JSON';
|
||||
const params = new URLSearchParams();
|
||||
|
||||
@@ -194,11 +194,19 @@
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData,
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_save").text("처리중 . . . . .");
|
||||
},
|
||||
success: function () {
|
||||
alert("<%= localeMessage.getString("common.saveMsg") %>");
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
},
|
||||
complate: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_save").text("수정");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -258,12 +266,20 @@
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: { cmd: 'DELETE', apiId: $('#apiId').val() },
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_delete").text("처리중 . . . . .");
|
||||
},
|
||||
success: function() {
|
||||
alert("<%= localeMessage.getString("common.deleteMsg") %>");
|
||||
window.close();
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
},
|
||||
complate: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_delete").text("삭제");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -276,6 +292,10 @@
|
||||
cmd: 'GENERATE_SPEC',
|
||||
apiId: $('#apiId').val()
|
||||
},
|
||||
beforeSend: function() {
|
||||
$("[id^='btn_']").prop("disabled", true);
|
||||
$("#btn_generate_spec").text("처리중 . . . . .");
|
||||
},
|
||||
success: function(data) {
|
||||
// Update the editors with generated content
|
||||
$('#apiRequestSpec').summernote('code', data.requestSpec);
|
||||
@@ -288,6 +308,10 @@
|
||||
},
|
||||
error: function(e) {
|
||||
alert("API 스펙 생성 중 오류가 발생했습니다: " + e.responseText);
|
||||
},
|
||||
complate: function() {
|
||||
$("[id^='btn_']").prop("disabled", false);
|
||||
$("#btn_generate_spec").text("SPEC 자동 생성");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user