260521_04_ENH: 파일 업로드 수정
This commit is contained in:
@@ -28,8 +28,52 @@
|
||||
right: 0px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
#uploadLoading{
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
#uploadLoading .upload-loading-box{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
min-width: 220px;
|
||||
padding: 24px 28px;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
#uploadLoading .upload-loading-spinner{
|
||||
width: 34px;
|
||||
height: 34px;
|
||||
margin: 0 auto 12px;
|
||||
border: 4px solid #ddd;
|
||||
border-top-color: #337ab7;
|
||||
border-radius: 50%;
|
||||
animation: uploadLoadingSpin 0.8s linear infinite;
|
||||
}
|
||||
#uploadLoading .upload-loading-text{
|
||||
font-weight: bold;
|
||||
}
|
||||
@keyframes uploadLoadingSpin{
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
<!--#include virtual="/Include/Top.asp"-->
|
||||
<div id="uploadLoading">
|
||||
<div class="upload-loading-box">
|
||||
<div class="upload-loading-spinner"></div>
|
||||
<div class="upload-loading-text">Uploading...</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="ListModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
@@ -360,8 +404,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
showUploadLoading("Reading file...");
|
||||
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(e){
|
||||
showUploadLoading("Processing upload...");
|
||||
setTimeout(function(){
|
||||
try{
|
||||
var workbook = XLSX.read(e.target.result, { type: "array" });
|
||||
var firstSheetName = workbook.SheetNames[0];
|
||||
@@ -375,14 +423,27 @@
|
||||
}catch(err){
|
||||
console.error(err);
|
||||
alert("파일을 읽는데 실패했습니다.");
|
||||
}finally{
|
||||
hideUploadLoading();
|
||||
}
|
||||
}, 50);
|
||||
};
|
||||
reader.onerror = function(){
|
||||
hideUploadLoading();
|
||||
alert("파일을 읽을수 없습니다.");
|
||||
};
|
||||
reader.readAsArrayBuffer(file);
|
||||
}
|
||||
|
||||
function showUploadLoading(message){
|
||||
$("#uploadLoading .upload-loading-text").text(message || "Uploading...");
|
||||
$("#uploadLoading").show();
|
||||
}
|
||||
|
||||
function hideUploadLoading(){
|
||||
$("#uploadLoading").hide();
|
||||
}
|
||||
|
||||
function runUploadedExcelTask(upsertUserRows, updateDeployRows){
|
||||
var upsertUsers = validateUserRow(upsertUserRows);
|
||||
const insertPhones = upsertUsers == undefined? [] : upsertUsers
|
||||
@@ -445,8 +506,8 @@
|
||||
var r_name = normalizeCode(row["이름"]);
|
||||
var r_phone = normalizeCode(row["연락처"]);
|
||||
var r_position = normalizeCode(row["직책"]);
|
||||
var r_area = normalizeCode(row["지역"], 2);
|
||||
var r_district = normalizeCode(row["권역"], 4);
|
||||
var r_area = normalizeCode(row["지역"]);
|
||||
var r_district = normalizeCode(row["권역"]);
|
||||
|
||||
if (r_phone == "NULL") {
|
||||
return returnError("지원자 정보", i, "연락처는 필수 입니다.");
|
||||
@@ -469,7 +530,7 @@
|
||||
}
|
||||
|
||||
if (r_district != "NULL") {
|
||||
if(r_district.substring(0, 2) != r_area) {
|
||||
if(r_district.substring(0, r_area.length) != r_area) {
|
||||
return returnError("지원자 정보", i, "지역과 권역이 맞지 않습니다.");
|
||||
}
|
||||
if(!codeMap.district[r_district]){
|
||||
@@ -482,11 +543,11 @@
|
||||
return returnError("지원자 정보", i, "신규지원자는 모든 정보가 필수 입니다.");
|
||||
}
|
||||
if (AjaxCheckExistPhone(r_phone)) {
|
||||
return returnError("지원자 정보", i, "신규지원자(연락처)는 이미 존재하여 추가할 수 없습니다.");
|
||||
return returnError("지원자 정보", i, "신규지원자(연락처 - "+r_phone+")는 이미 존재하여 추가할 수 없습니다.");
|
||||
}
|
||||
} else {
|
||||
if (!AjaxCheckExistPhone(r_phone)) {
|
||||
return returnError("지원자 정보", i, "없는 사용자(연락처) 입니다.");
|
||||
return returnError("지원자 정보", i, "없는 사용자(연락처 - "+r_phone+") 입니다.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,9 +578,15 @@
|
||||
var exitCd = String(exitRow.e_full_it).trim();
|
||||
var exitNm = normalizeName(exitRow.e_exit_nm);
|
||||
|
||||
if (exitCd !== "" && !exitCodeMap[exitCd]) {
|
||||
exitCodeMap[exitCd] = exitCd;
|
||||
}
|
||||
|
||||
/*
|
||||
if (exitNm !== "" && !exitCodeMap[exitNm]) {
|
||||
exitCodeMap[exitNm] = exitCd;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,23 +599,32 @@
|
||||
if (r_phone != "NULL" && r_phone.charAt(0) !== "0") {
|
||||
r_phone = "0" + r_phone;
|
||||
}
|
||||
var rawExitName = row["투표소 이름"] || row["투표소명"] || row["투표소 명"] || row["e_full_nm"] || row["e_exit_nm"] || row["투표구 명"] || row["투표구명"];
|
||||
var exit_nm = normalizeName(rawExitName);
|
||||
var exit_cd = exitCodeMap[exit_nm] || "NULL";
|
||||
//var rawExitName = row["투표소 이름"] || row["투표소명"] || row["투표소 명"] || row["e_full_nm"] || row["e_exit_nm"] || row["투표구 명"] || row["투표구명"];
|
||||
//var exit_nm = normalizeName(rawExitName);
|
||||
//var exit_cd = exitCodeMap[exit_nm] || "NULL";
|
||||
var rawExitCode = row["투표소 코드"] || row["투표소코드"] || row["투표구 코드"] || row["투표구코드"];
|
||||
var exit_cd = exitCodeMap[normalizeCode(rawExitCode)] || "NULL";
|
||||
|
||||
if (r_phone == "NULL") {
|
||||
return returnError("투표소 배정 및 해제", i, "연락처는 필수 입니다.");
|
||||
}
|
||||
if (!AjaxCheckExistPhone(r_phone) && !insertPhones.includes(r_phone)) {
|
||||
return returnError("투표소 배정 및 해제", i, "없는 사용자(연락처) 입니다.");
|
||||
return returnError("투표소 배정 및 해제", i, "없는 사용자(연락처 - "+r_phone+") 입니다.");
|
||||
}
|
||||
if (rawExitCode == "") {
|
||||
return returnError("투표소 배정 및 해제", i, "투표소 코드는 필수 입니다.");
|
||||
}
|
||||
if (exit_cd == "NULL") {
|
||||
return returnError("투표소 배정 및 해제", i, "투표소(" + rawExitCode + ")가 존재하지 않습니다.");
|
||||
}
|
||||
/*
|
||||
if (exit_nm == "") {
|
||||
return returnError("투표소 배정 및 해제", i, "투표소 이름은 필수 입니다.");
|
||||
}
|
||||
if (exit_cd == "NULL") {
|
||||
return returnError("투표소 배정 및 해제", i, "투표소(" + exit_nm + ")가 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
*/
|
||||
updateDeploys.push({
|
||||
gubun: gubun,
|
||||
r_phone: r_phone,
|
||||
|
||||
Reference in New Issue
Block a user