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