|
|
|
@ -32,6 +32,7 @@ function sttemntImgDownload(cmmFileDtls, appendElementId, reqDTO, isEditor) {
|
|
|
|
|
imgEl = document.createElement("div");
|
|
|
|
|
//FIXME: id 고정(#ctznImg - 변경불가)
|
|
|
|
|
imgEl.setAttribute("id", dtl.fileJobId);
|
|
|
|
|
imgEl.setAttribute("value", dtl.fileMastrId);
|
|
|
|
|
imgEl.setAttribute("class", "dragDiv")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -71,6 +72,9 @@ function sttemntImgDownload(cmmFileDtls, appendElementId, reqDTO, isEditor) {
|
|
|
|
|
document.querySelector('#imgList').appendChild(imgEl);
|
|
|
|
|
})
|
|
|
|
|
dragable();
|
|
|
|
|
/*orgJSON = dragableOrgdata();*/
|
|
|
|
|
|
|
|
|
|
/*orgImg = cmmFileDtls;*/
|
|
|
|
|
//<img src="/resources/framework/images/common/noImage.png"/>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -171,18 +175,17 @@ function downloadAll(imgs, ext, limit) {
|
|
|
|
|
function dragable() {
|
|
|
|
|
const draggables = document.querySelectorAll(".draggable");
|
|
|
|
|
const containers = document.querySelectorAll(".dragDiv");
|
|
|
|
|
console.log('draggable', draggables);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draggables.forEach(draggable => {
|
|
|
|
|
console.log(draggable);
|
|
|
|
|
draggable.addEventListener("dragstart", () => {
|
|
|
|
|
console.log('drag start')
|
|
|
|
|
console.log('drag start => ', draggable.getAttribute('id'));
|
|
|
|
|
draggable.classList.add("dragging");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
draggable.addEventListener("dragend", () => {
|
|
|
|
|
console.log('drag end')
|
|
|
|
|
console.log('drag end => ', draggable.getAttribute('data-file-mastr-id'));
|
|
|
|
|
draggable.classList.remove("dragging");
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
@ -221,3 +224,39 @@ function getDragAfterElement(container, x) {
|
|
|
|
|
}
|
|
|
|
|
/*이미지 드레그앤 드롭 end*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*이미지 드레그앤 드롭 저장 start*/
|
|
|
|
|
function dragableSave() {
|
|
|
|
|
let imgData = {};
|
|
|
|
|
let imgNode = document.querySelector("#imgList").childNodes;
|
|
|
|
|
console.log(imgNode);
|
|
|
|
|
|
|
|
|
|
for(let i=0; i<imgNode.length; i++) {
|
|
|
|
|
console.log('imgNode',imgNode[i]);
|
|
|
|
|
let imgNodeNo = imgNode[i];
|
|
|
|
|
imgNodeNo = imgNodeNo.attributes.value.value;
|
|
|
|
|
let imgNodeChild = imgNode[i].children;
|
|
|
|
|
|
|
|
|
|
var arr = new Array();
|
|
|
|
|
imgData[imgNodeNo] = arr;
|
|
|
|
|
|
|
|
|
|
for(let i=0; i<imgNodeChild.length; i++){
|
|
|
|
|
imgData[imgNodeNo].push(imgNodeChild[i].id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log('final', imgData);
|
|
|
|
|
const imgEl = imgData;
|
|
|
|
|
dragableSaveAjax(imgEl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function dragableSaveAjax(imgEl){
|
|
|
|
|
cmmAjax({
|
|
|
|
|
showSuccessMsg: false
|
|
|
|
|
,url: "/fims/biz/ec/saveImg.do"
|
|
|
|
|
,data: JSON.stringify(imgEl)
|
|
|
|
|
,contentType: 'application/json'
|
|
|
|
|
,success: (res) => {
|
|
|
|
|
alert('저장되었습니다.')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|