bin2107 преди 4 години
родител
ревизия
87249066c5
променени са 1 файла, в които са добавени 19 реда и са изтрити 3 реда
  1. 19 3
      src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

+ 19 - 3
src/main/webapp/WEB-INF/views/display/MainMultiContentsPopupForm.html

@@ -907,9 +907,18 @@ console.log('brandGroupNo:'+brandGroupNo);
 	var firstOrd = '';
 	//var uploadGoodsUrl = _goodsUrl [[${@environment.getProperty('upload.goods.view')}]];
 	var fnAddMultiContentsGoods = function(result){
-		console.log('goodsRowIdx>>>>'+addRowTd);
+		let thisIdx = $("#"+addRowTd).parent().parent().parent().parent().parent().find('input[name=tableIdx]').val();
+		// console.log('goodsRowIdx>>>>'+addRowTd);
+		let goodsCnt = 0;
+		if($("#"+addRowTd).find('.item').length > 0){
+			goodsCnt = $("#"+addRowTd).find('.item').length;
+		}
+
 		var html='';
 		for(let i = 0 ; i < result.length ; i++) {
+			let dispOrdVal = 0;
+			dispOrdVal = goodsCnt +(i+1);
+
 			if(i==0){
 				firstOrd = result[i].dispOrd;
 			}
@@ -924,6 +933,12 @@ console.log('brandGroupNo:'+brandGroupNo);
 				imgPath = _goodsUrl;
 			//}
 			html += '<img src="'+imgPath+ "/" +result[i].sysImgNm+'" onerror="this.src=\'/image/no.png\';"/>';
+			html += '<div class="btnArea">';
+			html += '<button type="button" class="icnSm" title="맨위로" onclick="fnUpdownBtn(this, \'up\', \''+thisIdx+'\');"><i class="fa fa-play-circle fa-rotate-270" aria-hidden="true"></i></button>';
+			html += '<button type="button" class="icnSm" title="위로" onclick="fnUpBtn(this, \''+thisIdx+'\');"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>';
+			html += '<button type="button" class="icnSm" title="맨아래로" onclick="fnUpdownBtn(this, \'down\', \''+thisIdx+'\');"><i class="fa fa-play-circle fa-rotate-90" aria-hidden="true"></i></button>';
+			html += '<button type="button" class="icnSm" title="아래로" onclick="fnDownBtn(this, \''+thisIdx+'\');"><i class="fa fa-arrow-down" aria-hidden="true"></i></button>';
+			html += '</div>';
 			html += '</li>';
 			html += '<li class="cont">';
 			html += '<ul>';
@@ -936,13 +951,14 @@ console.log('brandGroupNo:'+brandGroupNo);
 			html += '<li class="title">'+result[i].goodsNm+'</li>';
 			html += '<li>';
 			html += '<span>전시순서 :</span>';
-			html += '<input type="text" name="dispOrdEdit" value="'+(i+1)+'" />';
-			html += '<input type="hidden" name="setDispOrd" value="'+(i+1)+'"/>';
+			html += '<input type="text" name="dispOrdEdit" value="'+dispOrdVal+'" />';
+			html += '<input type="hidden" name="setDispOrd" value="'+dispOrdVal+'"/>';
 			html += '</li>';
 			html += '</ul>';
 			html += '</li>';
 			html += '</ul>';
 		}
+		
 		$("#"+addRowTd).append(html);
 		// $("#"+addRowTd).sortable();
 		$("#"+addRowTd).sortable({