|
|
@@ -46,6 +46,7 @@
|
|
|
var tdWidth = $("#sortable").find("td").width();
|
|
|
var tdDeleteWidth = parseInt(tdWidth/11, 10);
|
|
|
tdWidth = tdWidth - tdDeleteWidth;
|
|
|
+ var cate1List = [[${cate1List}]];
|
|
|
|
|
|
var tableLen = 0; // 테이블 ID
|
|
|
|
|
|
@@ -66,6 +67,7 @@
|
|
|
for(var i=0; i<result.length; i++){
|
|
|
var dispStdt = result[i].dispStdt.split(" ");
|
|
|
var dispEddt = result[i].dispEddt.split(" ");
|
|
|
+ var cate1No = result[i].contentsType;
|
|
|
html += '<table class="frmStyle mcTable" style="margin-bottom:30px" id="mcTable'+i+'">';
|
|
|
html += '<input type="hidden" name="tableIdx" value="'+i+'" data-id="'+i+'">';
|
|
|
html += '<colgroup>';
|
|
|
@@ -104,7 +106,7 @@
|
|
|
if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
|
|
|
}
|
|
|
- html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteContentsRow(this);">삭제</button></td>';
|
|
|
}
|
|
|
html += '</tr>';
|
|
|
@@ -241,44 +243,23 @@
|
|
|
}
|
|
|
html += ' </td>';
|
|
|
html += '</tr>';
|
|
|
- /*html += '<tr id="bannerImgTr1" name="imgPopRow">';
|
|
|
- html += ' <th>이미지1</th>';
|
|
|
- html += ' <td>';
|
|
|
- html += ' <div id="ImageArea1" style="height:33px;">';
|
|
|
- html += ' <span className="uFile w300">';
|
|
|
- html += ' <input id="file_1" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 1)"/>';
|
|
|
- html += ' <label htmlFor="file_1" className="uFileLabel"></label>';
|
|
|
- html += ' <input type="hidden" name="imgPath" value="'+result[i].imgPath1+'"/>';
|
|
|
- html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
- html += ' </span>';
|
|
|
- html += ' <span className="memAdd off" id="imgFileNm1"></span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr id="bannerLinkTr1" name="linkRow">';
|
|
|
- html += ' <th>링크1</th>';
|
|
|
- html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="'+result[i].strVar1+'"/></td>';
|
|
|
- html += '</tr>';
|
|
|
- if(result[i].contentsType==2){
|
|
|
- html += '<tr id="bannerImgTr2" name="imgPopRow">';
|
|
|
- html += ' <th>이미지2</th>';
|
|
|
- html += ' <td>';
|
|
|
- html += ' <div id="ImageArea2" style="height:33px;">';
|
|
|
- html += ' <span className="uFile w300">';
|
|
|
- html += ' <input id="file_2" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 2)"/>';
|
|
|
- html += ' <label htmlFor="file_2" className="uFileLabel"></label>';
|
|
|
- html += ' <input type="hidden" name="imgPath" value="'+result[i].imgPath2+'"/>';
|
|
|
- html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
- html += ' </span>';
|
|
|
- html += ' <span className="memAdd off" id="imgFileNm2"></span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr id="bannerLinkTr2" name="linkRow" >';
|
|
|
- html += ' <th>링크2</th>';
|
|
|
- html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="'+result[i].strVar2+'"/></td>';
|
|
|
- html += '</tr>';
|
|
|
- }*/
|
|
|
+ }
|
|
|
+ if(contentsLoc=='STAB003'){
|
|
|
+ html += ' <tr name="tabCateRow">';
|
|
|
+ html += ' <th>카테고리</th>';
|
|
|
+ html += ' <td colspan="3">카테고리선택';
|
|
|
+ html += ' <select name="cate1List">';
|
|
|
+ html += ' <option value="">[선택]</option>';
|
|
|
+ for(let i=0; i<cate1List.length; i++){
|
|
|
+ if(cate1No == cate1List[i].cd){
|
|
|
+ html += '<option value="'+cate1List[i].cd+'" selected="selected">['+cate1List[i].cd+'] '+cate1List[i].cdNm+'</option>';
|
|
|
+ }else{
|
|
|
+ html += '<option value="'+cate1List[i].cd+'">['+cate1List[i].cd+'] '+cate1List[i].cdNm+'</option>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ html += ' </select>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += ' </tr>';
|
|
|
}
|
|
|
html += '</thead><tbody>';
|
|
|
if(contentsLoc!='SCM002' && contentsLoc!='SCM003'){
|
|
|
@@ -457,42 +438,19 @@
|
|
|
html += ' <label class="rdoBtn"><input type="radio" name="bannerType'+dataIdx+'" value="2" >2단</label>';
|
|
|
html += ' </td>';
|
|
|
html += '</tr>';
|
|
|
- /*html += '<tr id="bannerImgTr1" name="imgPopRow" style="display: none;">';
|
|
|
- html += ' <th>이미지1</th>';
|
|
|
- html += ' <td>';
|
|
|
- html += ' <div id="ImageArea1" style="height:33px;">';
|
|
|
- html += ' <span className="uFile w300">';
|
|
|
- html += ' <input id="file_1" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 1)"/>';
|
|
|
- html += ' <label htmlFor="file_1" className="uFileLabel"></label>';
|
|
|
- html += ' <input type="hidden" name="imgPath" value=""/>';
|
|
|
- html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
- html += ' </span>';
|
|
|
- html += ' <span className="memAdd off" id="imgFileNm1"></span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr id="bannerLinkTr1" name="linkRow" style="display: none;">';
|
|
|
- html += ' <th>링크1</th>';
|
|
|
- html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="#"/></td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr id="bannerImgTr2" name="imgPopRow" style="display: none;">';
|
|
|
- html += ' <th>이미지2</th>';
|
|
|
- html += ' <td>';
|
|
|
- html += ' <div id="ImageArea2" style="height:33px;">';
|
|
|
- html += ' <span className="uFile w300">';
|
|
|
- html += ' <input id="file_2" name="file" type="file" className="uFileInput w300" data-valid-name="이미지파일" onChange="fnPopFileUpload(this, 2)"/>';
|
|
|
- html += ' <label htmlFor="file_2" className="uFileLabel"></label>';
|
|
|
- html += ' <input type="hidden" name="imgPath" value=""/>';
|
|
|
- html += ' <input type="hidden" name="newImgFile" value="" />';
|
|
|
- html += ' </span>';
|
|
|
- html += ' <span className="memAdd off" id="imgFileNm2"></span>';
|
|
|
- html += ' </div>';
|
|
|
- html += ' </td>';
|
|
|
- html += '</tr>';
|
|
|
- html += '<tr id="bannerLinkTr2" name="linkRow" style="display: none;">';
|
|
|
- html += ' <th>링크2</th>';
|
|
|
- html += ' <td><input type="text" class="w400" name="linkUrl" maxlength="300" required="required" data-valid-name="LINK" value="#"/></td>';
|
|
|
- html += '</tr>';*/
|
|
|
+ }
|
|
|
+ if(contentsLoc=='STAB003'){
|
|
|
+ html += ' <tr name="tabCateRow">';
|
|
|
+ html += ' <th>카테고리</th>';
|
|
|
+ html += ' <td colspan="3">카테고리선택';
|
|
|
+ html += ' <select name="cate1List">';
|
|
|
+ html += ' <option value="">[선택]</option>';
|
|
|
+ for(let i=0; i<cate1List.length; i++){
|
|
|
+ html += '<option value="'+cate1List[i].cd+'">['+cate1List[i].cd+'] '+cate1List[i].cdNm+'</option>';
|
|
|
+ }
|
|
|
+ html += ' </select>';
|
|
|
+ html += ' </td>';
|
|
|
+ html += ' </tr>';
|
|
|
}
|
|
|
html += '</thead><tbody>';
|
|
|
html += '</tbody></table>';
|
|
|
@@ -547,40 +505,6 @@
|
|
|
$("#mcTable"+tableDataId+" .planArea").find("input[name=planSq"+tableDataId+"]").val(result[0].planSq);
|
|
|
}
|
|
|
|
|
|
- // SMM005 데이터 validation 체크
|
|
|
- /*function smm005DataValidation(){
|
|
|
- $(".mcTable").each(function(i){
|
|
|
- var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
- var contentsType = $(this).find("input:radio[name=bannerType"+thisIdx+"]:checked").val();
|
|
|
-
|
|
|
- var imgPath1 = $(this).find("[id=ImageArea1]").find("input[name=imgPath]").val();
|
|
|
- var imgPath2 = $(this).find("[id=ImageArea2]").find("input[name=imgPath]").val();
|
|
|
- var link1 = $(this).find("[id=bannerLinkTr1]").find("input[name=linkUrl]").val();
|
|
|
- var link2 = $(this).find("[id=bannerLinkTr2]").find("input[name=linkUrl]").val();
|
|
|
-
|
|
|
- if(gagajf.isNull(imgPath1)){
|
|
|
- mcxDialog.alert('배너1 이미지를 선택해주세요.');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(gagajf.isNull(link1)){
|
|
|
- mcxDialog.alert('배너1 링크를 선택해주세요.');
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if(contentsType==2){
|
|
|
- if(gagajf.isNull(imgPath2)){
|
|
|
- mcxDialog.alert('배너2 이미지를 선택해주세요.');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(gagajf.isNull(link2)){
|
|
|
- mcxDialog.alert('배너2 링크를 선택해주세요.');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- return true;
|
|
|
- }*/
|
|
|
-
|
|
|
// SMM001 데이터 validation 체크
|
|
|
function smm001DataValidation(){
|
|
|
$(".mcTable").each(function(i){
|
|
|
@@ -607,6 +531,20 @@
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ // STAB003 데이터 validation 체크
|
|
|
+ function stab003DataValidation(){
|
|
|
+ $(".mcTable").each(function(i){
|
|
|
+ var cateValue = $(this).find("tr[name=tabCateRow]").find("select[name=cate1List] option:selected").val();
|
|
|
+ console.log('cateValue::'+cateValue);
|
|
|
+ if(gagajf.isNull(cateValue)){
|
|
|
+ mcxDialog.alert('적용할 카테고리를 선택해주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 임시저장
|
|
|
*/
|
|
|
@@ -622,11 +560,11 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*if(contentsLoc=='SMM005'){
|
|
|
- if(!smm005DataValidation()){
|
|
|
+ if(contentsLoc=='STAB003'){
|
|
|
+ if(!stab003DataValidation()){
|
|
|
return false;
|
|
|
}
|
|
|
- }*/
|
|
|
+ }
|
|
|
|
|
|
var titleBool = true;
|
|
|
$("#popSortable").find('input[name=title]').each(function(idx, title) {
|
|
|
@@ -719,10 +657,6 @@
|
|
|
if(contentsLoc=='SMM005'){
|
|
|
var thisIdx = $(this).find("input[name=tableIdx]").val();
|
|
|
contentsType = $(this).find("input:radio[name=bannerType"+thisIdx+"]:checked").val();
|
|
|
- /*imgPath1 = $(this).find("#ImageArea1").find("input[name=imgPath]").val();
|
|
|
- strVar1 = $(this).find("#bannerLinkTr1").find("input[name=linkUrl]").val();
|
|
|
- imgPath2 = $(this).find("#ImageArea2").find("input[name=imgPath]").val();
|
|
|
- strVar2 = $(this).find("#bannerLinkTr2").find("input[name=linkUrl]").val();*/
|
|
|
}
|
|
|
|
|
|
if(contentsLoc=='SCM002' || contentsLoc=='SCM003'){
|
|
|
@@ -732,6 +666,11 @@
|
|
|
strVar1 = $(this).find("input:radio[name=dispCnt]:checked").val();
|
|
|
}
|
|
|
|
|
|
+ if(contentsLoc=='STAB003'){
|
|
|
+ var cateValue = $(this).find("tr[name=tabCateRow]").find("select[name=cate1List] option:selected").val();
|
|
|
+ contentsType = cateValue;
|
|
|
+ }
|
|
|
+
|
|
|
var data = {cateNo : cateNo
|
|
|
, contentsLoc : contentsLoc
|
|
|
, contentsType : contentsType
|