|
|
@ -2,7 +2,7 @@ LoadScript("sortableScript","/webjars/3rd-party/sneat/libs/sortablejs/sortable.j
|
|
|
|
|
|
|
|
|
|
|
|
function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
|
|
|
|
|
|
|
|
var $P = pageObject[pageName];
|
|
|
|
let $P = pageObject[pageName];
|
|
|
|
|
|
|
|
|
|
|
|
$P.existFileArr = [];
|
|
|
|
$P.existFileArr = [];
|
|
|
|
$P.localUploadArr = [];
|
|
|
|
$P.localUploadArr = [];
|
|
|
@ -11,7 +11,7 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
$P.carLinkFunc = carLinkFunc;
|
|
|
|
$P.carLinkFunc = carLinkFunc;
|
|
|
|
|
|
|
|
|
|
|
|
//드래그앤드롭
|
|
|
|
//드래그앤드롭
|
|
|
|
Sortable.create(document.getElementById("dragAndDrop--"+pageName), {
|
|
|
|
Sortable.create($P.find("dragAndDrop"), {
|
|
|
|
onEnd : function(evt){
|
|
|
|
onEnd : function(evt){
|
|
|
|
if(evt.oldIndex != evt.newIndex){
|
|
|
|
if(evt.oldIndex != evt.newIndex){
|
|
|
|
$P.updateFileInfo("changeOrder");
|
|
|
|
$P.updateFileInfo("changeOrder");
|
|
|
@ -21,11 +21,11 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
|
|
|
|
|
|
|
|
//파일처리 버튼
|
|
|
|
//파일처리 버튼
|
|
|
|
//추가버튼
|
|
|
|
//추가버튼
|
|
|
|
$("#btnAddFile--"+pageName).on('click', () => {
|
|
|
|
$P.$find("btnAddFile").on('click', () => {
|
|
|
|
$("#inputUploadSet--"+pageName).trigger("click");
|
|
|
|
$P.$find("inputUploadSet").trigger("click");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//동영상캡쳐버튼
|
|
|
|
//동영상캡쳐버튼
|
|
|
|
$("#btnOpenVideoCapture--"+pageName).on('click', () => {
|
|
|
|
$P.$find("btnOpenVideoCapture").on('click', () => {
|
|
|
|
var crdnId = $(crdnIdElement).val();
|
|
|
|
var crdnId = $(crdnIdElement).val();
|
|
|
|
|
|
|
|
|
|
|
|
var popupWidth = 1800;
|
|
|
|
var popupWidth = 1800;
|
|
|
@ -46,8 +46,8 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//편집버튼
|
|
|
|
//편집버튼
|
|
|
|
$("#btnEditPhoto--"+pageName).on('click', async() => {
|
|
|
|
$P.$find("btnEditPhoto").on('click', async() => {
|
|
|
|
var checked = $("#displayForExist--"+pageName).find("[name='existPhoto']:checked");
|
|
|
|
var checked = $P.$find("displayForExist").find("[name='existPhoto']:checked");
|
|
|
|
if(checked.length < 1){
|
|
|
|
if(checked.length < 1){
|
|
|
|
await alert2("선택된 사진이 없습니다.");
|
|
|
|
await alert2("선택된 사진이 없습니다.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -72,9 +72,9 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//삭제버튼
|
|
|
|
//삭제버튼
|
|
|
|
$("#btnDeleteExistPhoto--"+pageName).on('click', async() => {
|
|
|
|
$P.$find("btnDeleteExistPhoto").on('click', async() => {
|
|
|
|
|
|
|
|
|
|
|
|
var checked = $("#displayForExist--"+pageName).find("[name='existPhoto']:checked");
|
|
|
|
var checked = $P.$find("displayForExist").find("[name='existPhoto']:checked");
|
|
|
|
if(checked.length < 1){
|
|
|
|
if(checked.length < 1){
|
|
|
|
await alert2("선택된 사진이 없습니다.");
|
|
|
|
await alert2("선택된 사진이 없습니다.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -91,7 +91,7 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
$P.updateFileInfo("delete");
|
|
|
|
$P.updateFileInfo("delete");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$P.uploadSet = uploadSupport("#inputUploadSet--"+pageName);
|
|
|
|
$P.uploadSet = uploadSupport($P.selector("inputUploadSet"));
|
|
|
|
|
|
|
|
|
|
|
|
$P.uploadSet.onDatasetChange = () => {
|
|
|
|
$P.uploadSet.onDatasetChange = () => {
|
|
|
|
|
|
|
|
|
|
|
@ -123,9 +123,9 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
// pageName에 따라 template이 다르다.
|
|
|
|
// pageName에 따라 template이 다르다.
|
|
|
|
var template;
|
|
|
|
var template;
|
|
|
|
if (pageName == "sprt02020") {
|
|
|
|
if (pageName == "sprt02020") {
|
|
|
|
template = document.getElementById("imgRadioTemplateTotalInfo--" + pageName).innerHTML;
|
|
|
|
template = $P.find("imgRadioTemplateTotalInfo").innerHTML;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
template = document.getElementById("imgRadioTemplate--" + pageName).innerHTML;
|
|
|
|
template = $P.find("imgRadioTemplate").innerHTML;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
template = template.replace(/{name}/gi, "existPhoto");
|
|
|
|
template = template.replace(/{name}/gi, "existPhoto");
|
|
|
@ -155,11 +155,11 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
var tagsText = $P.fnMakeImgForExistFile($P.existFileArr);
|
|
|
|
var tagsText = $P.fnMakeImgForExistFile($P.existFileArr);
|
|
|
|
|
|
|
|
|
|
|
|
if(tagsText == ""){
|
|
|
|
if(tagsText == ""){
|
|
|
|
document.querySelector("#dragAndDrop--"+pageName).innerHTML = "";
|
|
|
|
$P.find("dragAndDrop").innerHTML = "";
|
|
|
|
$("#btnEditPhoto--"+pageName).hide();
|
|
|
|
$P.$find("btnEditPhoto").hide();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
document.querySelector("#dragAndDrop--"+pageName).innerHTML = tagsText;
|
|
|
|
$P.find("dragAndDrop").innerHTML = tagsText;
|
|
|
|
$("#btnEditPhoto--"+pageName).show();
|
|
|
|
$P.$find("btnEditPhoto").show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -216,7 +216,7 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
// 사진 저장
|
|
|
|
// 사진 저장
|
|
|
|
$P.updateFileInfo = (flag) => {
|
|
|
|
$P.updateFileInfo = (flag) => {
|
|
|
|
|
|
|
|
|
|
|
|
var formData = new FormData(document.getElementById("frmFile--"+pageName));
|
|
|
|
var formData = new FormData($P.find("frmFile"));
|
|
|
|
formData.append("crdnId", $(crdnIdElement).val());
|
|
|
|
formData.append("crdnId", $(crdnIdElement).val());
|
|
|
|
formData.append("atchFileCnt", $P.existFileArr.length);
|
|
|
|
formData.append("atchFileCnt", $P.existFileArr.length);
|
|
|
|
|
|
|
|
|
|
|
@ -260,7 +260,7 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
} else if(flag == "changeOrder"){
|
|
|
|
} else if(flag == "changeOrder"){
|
|
|
|
fileProcessingURL = wctx.url("file/changeOrderCrdnImageFile.do");
|
|
|
|
fileProcessingURL = wctx.url("file/changeOrderCrdnImageFile.do");
|
|
|
|
|
|
|
|
|
|
|
|
var inputs = $("#dragAndDrop--"+pageName).find("input[name='existPhoto']");
|
|
|
|
var inputs = $P.$find("dragAndDrop").find("input[name='existPhoto']");
|
|
|
|
for(var i=0; i < inputs.length; i++){
|
|
|
|
for(var i=0; i < inputs.length; i++){
|
|
|
|
formData.append("orderedKeys", inputs[i].value);
|
|
|
|
formData.append("orderedKeys", inputs[i].value);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -298,13 +298,13 @@ function settingPhotoMain(pageName, crdnIdElement, carInfoFunc, carLinkFunc){
|
|
|
|
|
|
|
|
|
|
|
|
function initPhotoMain(pageName, fileList, existVideo){
|
|
|
|
function initPhotoMain(pageName, fileList, existVideo){
|
|
|
|
|
|
|
|
|
|
|
|
var $P = pageObject[pageName];
|
|
|
|
let $P = pageObject[pageName];
|
|
|
|
|
|
|
|
|
|
|
|
//동영상캡쳐버튼
|
|
|
|
//동영상캡쳐버튼
|
|
|
|
if(existVideo){
|
|
|
|
if(existVideo){
|
|
|
|
$("#btnOpenVideoCapture--"+pageName).show();
|
|
|
|
$P.$find("btnOpenVideoCapture").show();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#btnOpenVideoCapture--"+pageName).hide();
|
|
|
|
$P.$find("btnOpenVideoCapture").hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$P.existFileArr = [];
|
|
|
|
$P.existFileArr = [];
|
|
|
@ -316,8 +316,8 @@ function initPhotoMain(pageName, fileList, existVideo){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$P.localUploadArr = [];
|
|
|
|
$P.localUploadArr = [];
|
|
|
|
$("#inputUploadSet--"+pageName)[0].value = "";
|
|
|
|
$P.find("inputUploadSet").value = "";
|
|
|
|
$("#inputUploadSet--"+pageName).trigger("change");
|
|
|
|
$P.$find("inputUploadSet").trigger("change");
|
|
|
|
|
|
|
|
|
|
|
|
$P.fnDisplay();
|
|
|
|
$P.fnDisplay();
|
|
|
|
}
|
|
|
|
}
|