2024-02-08 02:26:11 +00:00
|
|
|
// 상단탭메뉴 //
|
|
|
|
|
function show_leemocon(tabnum){
|
|
|
|
|
var i;
|
|
|
|
|
var d = new Array(3); //메뉴갯수를 넣어주세요
|
|
|
|
|
var tm = document.getElementById("tabmenu").getElementsByTagName("li");
|
|
|
|
|
for(i=0; i<=2; i++){ //메뉴갯수보다 하나 작은수를 넣어주세요
|
|
|
|
|
|
|
|
|
|
d[i] = document.getElementById("tabcontent"+i);
|
|
|
|
|
d[i].style.display = "none";
|
|
|
|
|
tm[i].className = "";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch(tabnum){
|
|
|
|
|
case tabnum:
|
|
|
|
|
d[tabnum].style.display = "";
|
|
|
|
|
tm[tabnum].className = "on";
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//COMMON함수
|
|
|
|
|
|
|
|
|
|
//달력팝업
|
|
|
|
|
function fn_CalPopup(id,top,left){
|
|
|
|
|
var topIndex = 0;
|
|
|
|
|
|
|
|
|
|
//스크린 중간보다 아래일경우
|
|
|
|
|
var size = top -screen.height/2;
|
|
|
|
|
if(size > 0){
|
|
|
|
|
topIndex = top - 200 + size;
|
|
|
|
|
}else{
|
|
|
|
|
topIndex = top;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var option =",toobar=no,location=no,menubar=no,scrollbars=no,status=no,resizable=no,fullscreen=no";
|
|
|
|
|
window.open("/web/popup/cal.jsp?id="+id,"Calendar","width=100px, height=190px, top="+topIndex+"px, left="+left+"px "+option);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//달력팝업
|
|
|
|
|
function fn_CalPopupDiv(id,calId,divId){
|
|
|
|
|
var cal = $("#"+calId);
|
|
|
|
|
var calPosition = cal.position();
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'post',
|
|
|
|
|
url : '/web/popup/calender.jsp?id='+id,
|
|
|
|
|
async : false,
|
|
|
|
|
data : {},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert('Unknown error ' + status);
|
|
|
|
|
},
|
|
|
|
|
success : function(data) {
|
|
|
|
|
$("#"+ divId).css({'top' : calPosition.top - 25, 'left' : calPosition.left + 170});
|
|
|
|
|
$("#"+ divId).removeClass("trViewOff");
|
|
|
|
|
$("#"+ divId).html(data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//공급자 상세정보 팝업
|
|
|
|
|
function fn_ProviderInfoPopupDiv(id,divId){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'get',
|
|
|
|
|
url : '/provider_info.do?PRO_USERID='+id,
|
|
|
|
|
async : false,
|
|
|
|
|
// data : {},
|
|
|
|
|
error:function(request,status,error){
|
|
|
|
|
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
|
|
|
|
},
|
|
|
|
|
success : function(data) {
|
|
|
|
|
$("#"+ divId).css({'top' : 46, 'left' : 305});
|
|
|
|
|
$("#"+ divId).removeClass("trViewOff");
|
|
|
|
|
$("#"+ divId).html(data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//기타 공통으로 팝업 - 열려야 하는 팝업 URL, 필요한 Param
|
|
|
|
|
function fn_openPopup(popUrl, param, width, height){
|
|
|
|
|
var option =",toobar=no,location=no,menubar=no,status=no, scrollbars=yes";
|
|
|
|
|
var popWin = window.open(popUrl + "?"+param+"&width="+width+"&height="+height,"popup","width="+width+", height="+height+", top=50px, left=100px "+option);
|
|
|
|
|
if(popWin != null) popWin.focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//10보다 작은 수 0붙이기
|
|
|
|
|
function fn_setZero(num){
|
|
|
|
|
var no = Number(num);
|
|
|
|
|
var retValue = num;
|
|
|
|
|
if(no < 10){
|
|
|
|
|
retValue = "0"+no;
|
|
|
|
|
}
|
|
|
|
|
return retValue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Selectbox selected -- 2중이상 콤보 포함
|
|
|
|
|
function fn_SelectedData(frm, value, comm, type, conType, frm02, value02, comm02 , Depth ){
|
|
|
|
|
|
|
|
|
|
//alert("fn_selectedData");
|
|
|
|
|
|
|
|
|
|
frm.value = value;
|
|
|
|
|
|
|
|
|
|
if(type=="multi"){
|
|
|
|
|
|
|
|
|
|
//공통
|
|
|
|
|
if(conType == "comm"){
|
|
|
|
|
fn_onSelChange(comm,comm02,frm,frm02);
|
|
|
|
|
frm02.value = value02;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//발주처
|
|
|
|
|
if(conType == "GDis" ){
|
|
|
|
|
fn_onSelChangeGDis(comm,comm02,frm,frm02,Depth);
|
|
|
|
|
frm02.value = value02;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//지자체
|
|
|
|
|
if(conType == "Dis"){
|
|
|
|
|
fn_onSelChangeDis(comm,comm02,frm,frm02);
|
|
|
|
|
frm02.value = value02;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//숫자만 입력 가능
|
|
|
|
|
function isNumberKey(evt) {
|
|
|
|
|
|
|
|
|
|
if ((evt.keyCode<48) || (evt.keyCode>57)) {
|
|
|
|
|
evt.returnValue = false;
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//필수체크 확인 시 사용 (널확인, 빈칸확인)
|
|
|
|
|
function fn_isNull(str){
|
|
|
|
|
var reStr = "";
|
|
|
|
|
if(str == null){
|
|
|
|
|
reStr = "";
|
|
|
|
|
}else{
|
|
|
|
|
reStr = fn_trim(str);
|
|
|
|
|
}
|
|
|
|
|
return reStr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//필수 입력 체크
|
|
|
|
|
function fn_notNullValid(frm){
|
|
|
|
|
var formObj = frm;
|
|
|
|
|
for(var i=0; i<formObj.length; i++){
|
|
|
|
|
|
|
|
|
|
if(formObj[i].type == "text" || formObj[i].type == "select-one" || formObj[i].type == "textarea"){
|
|
|
|
|
if(!(formObj[i].id == "PROJECT_START_SPOT_SD" || formObj[i].id == "PROJECT_START_SPOT_SGG" || formObj[i].id == "PROJECT_START_SPOT_EMD" || formObj[i].id == "PROJECT_START_SPOT"
|
|
|
|
|
|| formObj[i].id == "PROJECT_END_SPOT_SD" || formObj[i].id == "PROJECT_END_SPOT_SGG" || formObj[i].id == "PROJECT_END_SPOT_EMD" || formObj[i].id == "PROJECT_END_SPOT")){
|
|
|
|
|
if(fn_isNull(formObj[i].value) == "" && formObj[i].getAttribute("valid") == "notnull"){
|
|
|
|
|
alert(formObj[i].getAttribute("validNm")+"(은/는) 필수입력사항입니다.");
|
|
|
|
|
fn_progressbarHide();
|
|
|
|
|
formObj[i].value = "";
|
|
|
|
|
formObj[i].focus();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//수정 작업 결과 XML을 가져와 Ajax로 서버로 보내기
|
|
|
|
|
//서버의 설정에 따라 serverUrl를 변경하시기 바랍니다.
|
|
|
|
|
var xmlHttp;
|
|
|
|
|
var pUrl = "";
|
|
|
|
|
function fn_submitToServer(strUrl, rUrl, dataGrid, gridRoot) {
|
|
|
|
|
// 에디팅 상태면 에디팅을 닫히도록 한다.
|
|
|
|
|
dataGrid.setEnabled(false);
|
|
|
|
|
dataGrid.setEnabled(true);
|
|
|
|
|
|
|
|
|
|
var serverUrl = strUrl;
|
|
|
|
|
var changedDataXML = gridRoot.getChangedDataXML();
|
|
|
|
|
if (changedDataXML == null) {
|
|
|
|
|
location.href=rUrl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
xmlHttp = new XMLHttpRequest();
|
|
|
|
|
} catch(trymicrosoft) {
|
|
|
|
|
try {
|
|
|
|
|
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
|
|
|
|
|
} catch(othermicrosoft) {
|
|
|
|
|
try {
|
|
|
|
|
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
|
|
|
|
|
} catch(failed) {
|
|
|
|
|
xmlHttp = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!xmlHttp) {
|
|
|
|
|
alert("Error initializing XMLHttpRequest!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xmlHttp.onreadystatechange = handleStateChange;
|
|
|
|
|
xmlHttp.open("POST", serverUrl, true);
|
|
|
|
|
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=utf-8");
|
|
|
|
|
xmlHttp.send("changedDataXML="+encodeURIComponent("<changedData>"+changedDataXML+"</changedData>"));
|
|
|
|
|
pUrl = rUrl;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//모든 데이터 저장하기 (파일첨부)
|
|
|
|
|
var xmlHttpAll;
|
|
|
|
|
function fn_submitToServerAll(strUrl, rUrl, dataGrid, gridRoot, colCount, rowCount , frm, startIndex) {
|
|
|
|
|
|
|
|
|
|
var changedDataXML = fn_allDataXml(gridRoot, colCount, rowCount, startIndex);
|
|
|
|
|
document.getElementById("dataAll").value = "<changedData>"+changedDataXML+"</changedData>";
|
|
|
|
|
|
|
|
|
|
var $form = $(frm);
|
|
|
|
|
$form.append("<input type=\"hidden\" name=\"rUrl\" id=\"rUrl\" value=\""+rUrl+"\"/>");
|
|
|
|
|
frm.action = strUrl;
|
|
|
|
|
frm.method = "POST";
|
|
|
|
|
frm.submit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//2개의 그리드 (파일첨부포함)
|
|
|
|
|
function fn_submitToServer02(strUrl, rUrl, dataGrid, dataGrid2, data1, data2, frm) {
|
|
|
|
|
|
|
|
|
|
document.getElementById("data1").value = "<changedData>"+data1+"</changedData>";
|
|
|
|
|
document.getElementById("data2").value = "<changedData>"+data2+"</changedData>";
|
|
|
|
|
|
|
|
|
|
var $form = $(frm);
|
|
|
|
|
$form.append("<input type=\"hidden\" name=\"rUrl\" id=\"rUrl\" value=\""+rUrl+"\"/>");
|
|
|
|
|
frm.action = strUrl;
|
|
|
|
|
frm.method = "POST";
|
|
|
|
|
frm.submit();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fn_isNullGrid(str){
|
|
|
|
|
if(str == null){
|
|
|
|
|
return "";
|
|
|
|
|
}else{
|
|
|
|
|
if($.trim(str) == ""){
|
|
|
|
|
return "";
|
|
|
|
|
}else{
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//저장 데이터 만들기
|
|
|
|
|
function fn_allDataXml(gridRoot, colCount, rowCount, startIndex){
|
|
|
|
|
|
|
|
|
|
var s = "<changedData>";
|
|
|
|
|
|
|
|
|
|
var m = "";
|
|
|
|
|
for(var i=0; i<rowCount; i++){
|
|
|
|
|
m = m + "<data>";
|
|
|
|
|
|
|
|
|
|
for(var j=startIndex; j<colCount; j++){
|
|
|
|
|
var column = dataGrid.getColumns()[j];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
m = m+ "<"+dataField+">"+fn_isNullGrid(gridRoot.getItemFieldAt(i, dataField))+"</"+dataField+">";
|
|
|
|
|
}
|
|
|
|
|
m = m+ "<COLUMN>"+fn_isNullGrid(gridRoot.getItemFieldAt(i, "COLUMN"))+"</COLUMN>";
|
|
|
|
|
m = m + "</data>";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var e = "</changedData>";
|
|
|
|
|
return s+m+e;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//저장 데이터 만들기
|
|
|
|
|
function fn_allDataXml02(gridRoot, colCount, rowCount, startIndex, dataGrid){
|
|
|
|
|
|
|
|
|
|
var s = "<changedData>";
|
|
|
|
|
|
|
|
|
|
var m = "";
|
|
|
|
|
for(var i=0; i<rowCount; i++){
|
|
|
|
|
m = m + "<data>";
|
|
|
|
|
|
|
|
|
|
for(var j=startIndex; j<colCount; j++){
|
|
|
|
|
|
|
|
|
|
var column = dataGrid.getColumns()[j];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
|
|
|
|
|
m = m+ "<"+dataField+">"+fn_isNullGrid(gridRoot.getItemFieldAt(i, dataField))+"</"+dataField+">";
|
|
|
|
|
}
|
|
|
|
|
m = m+ "<COLUMN>"+fn_isNullGrid(gridRoot.getItemFieldAt(i, "COLUMN"))+"</COLUMN>";
|
|
|
|
|
m = m + "</data>";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var e = "</changedData>";
|
|
|
|
|
return s+m+e;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function handleStateChange() {
|
|
|
|
|
if (xmlHttp.readyState == 4) {
|
|
|
|
|
if (xmlHttp.status == 200) {
|
|
|
|
|
if(fn_trim(xmlHttp.responseText) != ""){
|
|
|
|
|
alert(fn_trim(xmlHttp.responseText));
|
|
|
|
|
}
|
|
|
|
|
window.location.href=pUrl;
|
|
|
|
|
} else {
|
|
|
|
|
// 로컬에서 수행시 접속할 서버가 없어 3이 반환됩니다. 서버에서 실행하며 serverUrl 의 url이 실제 수행가능해야 정상적으로 작동합니다.
|
|
|
|
|
alert("서버 오류 status:"+xmlHttp.status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleStateChangeAll() {
|
|
|
|
|
if (xmlHttpAll.readyState == 4) {
|
|
|
|
|
if (xmlHttpAll.status == 200) {
|
|
|
|
|
alert(fn_trim(xmlHttpAll.responseText));
|
|
|
|
|
window.location.href=pUrl;
|
|
|
|
|
} else {
|
|
|
|
|
// 로컬에서 수행시 접속할 서버가 없어 3이 반환됩니다. 서버에서 실행하며 serverUrl 의 url이 실제 수행가능해야 정상적으로 작동합니다.
|
|
|
|
|
alert("서버 오류 status:"+xmlHttpAll.status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//그리드 필수입력 저장시
|
|
|
|
|
function fn_saveGridValid(cnt, item, gridRoot, dataGrid, grid){
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i <cnt; i++) {
|
|
|
|
|
|
|
|
|
|
for(var j=0; j<item.length; j++){
|
|
|
|
|
if(fn_isNull(gridRoot.getItemFieldAt(i, item[j]["COLUMN_FIELD"])) == ""){
|
|
|
|
|
alert(item[j]["COLUMN_NM"]+"(은/는) 필수입력입니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
if(item[j]["COLUMN_FIELD"] != "LAYER_SOIL_COLOR"){ //지층정보의 지층색은 선택해서 값 입력하는것이라 예외처리.
|
|
|
|
|
setEditedItemPosition2(item[j]["COLUMN_INDEX"], i , grid, dataGrid);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//라디오 선택된 값 가져오기
|
|
|
|
|
function fn_rdoSelValue(frm){
|
|
|
|
|
var mylen = frm.length;
|
|
|
|
|
var coor02 = "";
|
|
|
|
|
if (mylen == "undefined") //조회된 갯수가 1개일경우
|
|
|
|
|
{
|
|
|
|
|
mylen = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for ( var i = 0; i < mylen; i++)
|
|
|
|
|
{
|
|
|
|
|
if (frm[i].checked == true)
|
|
|
|
|
{
|
|
|
|
|
coor02 = frm[i].value;
|
|
|
|
|
return coor02;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return coor02;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//라디오 비활성화
|
|
|
|
|
function fn_rdoDisableValue(frm,val){
|
|
|
|
|
var mylen = frm.length;
|
|
|
|
|
if (mylen == "undefined") //조회된 갯수가 1개일경우
|
|
|
|
|
{
|
|
|
|
|
mylen = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for ( var i = 0; i < mylen; i++)
|
|
|
|
|
{
|
|
|
|
|
if (frm[i].value == val)
|
|
|
|
|
{
|
|
|
|
|
frm[i].disabled = true;
|
|
|
|
|
frm[i].checked = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//라디오 활성화
|
|
|
|
|
function fn_rdoAbleValue(frm,val){
|
|
|
|
|
var mylen = frm.length;
|
|
|
|
|
if (mylen == "undefined") //조회된 갯수가 1개일경우
|
|
|
|
|
{
|
|
|
|
|
mylen = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for ( var i = 0; i < mylen; i++)
|
|
|
|
|
{
|
|
|
|
|
if (frm[i].value == val)
|
|
|
|
|
{
|
|
|
|
|
frm[i].disabled = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//라디오 checked 설정
|
|
|
|
|
function fn_rdoCheckValue(frm,val){
|
|
|
|
|
var mylen = frm.length;
|
|
|
|
|
if (mylen == "undefined") //조회된 갯수가 1개일경우
|
|
|
|
|
{
|
|
|
|
|
mylen = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for ( var i = 0; i < mylen; i++)
|
|
|
|
|
{
|
|
|
|
|
if (frm[i].value == val)
|
|
|
|
|
{
|
|
|
|
|
frm[i].checked = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//체크박스 설정
|
|
|
|
|
function fn_chkCheckValue(frm,val,chkVal){
|
|
|
|
|
if(val == chkVal){
|
|
|
|
|
frm.checked = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Grid 포커스 포지션
|
|
|
|
|
function setEditedItemPosition(colIndex, rowIndex , grid) {
|
|
|
|
|
var editedCell = {columnIndex:colIndex, rowIndex:rowIndex};
|
|
|
|
|
dataGrid.setEditedItemPosition(editedCell);
|
|
|
|
|
document.getElementById(grid).focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Grid 포커스 포지션
|
|
|
|
|
function setEditedItemPosition2(colIndex, rowIndex , grid, dataGrid) {
|
|
|
|
|
var editedCell = {columnIndex:colIndex, rowIndex:rowIndex};
|
|
|
|
|
dataGrid.setEditedItemPosition(editedCell);
|
|
|
|
|
document.getElementById(grid).focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 아직 사용하는 곳은 없음
|
|
|
|
|
function setItemEditable(colIndex, rowIndex , grid, dataGrid) {
|
|
|
|
|
var editedCell = {columnIndex:colIndex, rowIndex:rowIndex};
|
|
|
|
|
dataGrid.setEditedItemPosition(editedCell);
|
|
|
|
|
dataGrid.editable(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//아이템 내역 수정
|
|
|
|
|
function changeItem(selectedValue, rowIndex, dataField, gridRoot) {
|
|
|
|
|
gridRoot.setItemFieldAt(selectedValue, rowIndex, dataField);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//FROM,TO검사
|
|
|
|
|
function fn_fromToCheck(value01, value02){
|
|
|
|
|
|
|
|
|
|
if(Number(value01) > Number(value02)){
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//FROM TO 문장 만들기
|
|
|
|
|
function fn_fromToCheckDesc(title01, title02){
|
|
|
|
|
|
|
|
|
|
return title01+"값이 "+title02+"보다 큽니다.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//날짜 체크
|
|
|
|
|
function fn_fromToCheckAlert(value01, value02, title01, title02, focusid){
|
|
|
|
|
|
|
|
|
|
if(fn_fromToCheck(value01,value02) == false){
|
|
|
|
|
alert(fn_fromToCheckDesc(title01,title02));
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
if(focusid != ""){
|
|
|
|
|
$("#"+focusid).focus();
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------ 파일 체크관련 시작
|
|
|
|
|
//파일사이즈, 확장자 검사
|
|
|
|
|
function fn_fileCheck(gridRoot, rowCount, colCount, seqID1, seqID2, fileId, gubun, startCount){
|
|
|
|
|
|
|
|
|
|
if(gubun == "R" && rowCount > 0){
|
|
|
|
|
for(var f = 0; f < rowCount; f++){
|
|
|
|
|
var seq = gridRoot.getItemFieldAt(f, seqID1);
|
|
|
|
|
|
|
|
|
|
//seq 두개의 조합으로 생길 때-----------------------------add
|
|
|
|
|
if(seqID2 != "") seq += "_" + gridRoot.getItemFieldAt(f, seqID2);
|
|
|
|
|
//seq 두개의 조합으로 생길 때-----------------------------add
|
|
|
|
|
|
|
|
|
|
if(!fn_fileTotalCheck(fileId+seq)){
|
|
|
|
|
fn_fileClear(fileId+seq);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(startCount == null || startCount == "" || startCount == "undefined"){
|
|
|
|
|
startCount = 999;
|
|
|
|
|
}
|
|
|
|
|
if(gubun == "C" && colCount >= startCount){
|
|
|
|
|
//alert("CV");
|
|
|
|
|
//첨부파일이 있을경우 확장자 체크
|
|
|
|
|
for(var f = 1; f < (colCount - (startCount-1)); f++){
|
|
|
|
|
var seq = gridRoot.getItemFieldAt(0, seqID1+f);
|
|
|
|
|
|
|
|
|
|
//seq 두개의 조합으로 생길 때-----------------------------add
|
|
|
|
|
if(seqID2 != "") seq += "_" + gridRoot.getItemFieldAt(0, seqID2+f);
|
|
|
|
|
//seq 두개의 조합으로 생길 때-----------------------------add
|
|
|
|
|
// 테스트
|
|
|
|
|
//alert("fileId : " + fileId + seq);
|
|
|
|
|
if(!fn_fileTotalCheck(fileId+seq)){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
//파일 사이즈, 확장자 토탈 검사
|
|
|
|
|
function fn_fileTotalCheck(fileId) {
|
|
|
|
|
|
|
|
|
|
if($("#"+fileId).val() != ""){
|
|
|
|
|
//alert(field);
|
|
|
|
|
if(fn_fileExtCheck(fileId,"jpg,jpeg,gif,bmp,tiff,png") == true){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(fn_fileSizeCheck(fileId, (1024 * 5000)) == false ){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2018-09-10 파일 사이즈, 확장자 토탈 검사
|
|
|
|
|
function fn_fileTotalCheck2(fileId, ext) {
|
|
|
|
|
if($("#"+fileId).val() != ""){
|
|
|
|
|
if(fn_fileExtCheck2(fileId,ext) == true){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(fn_fileSizeCheck(fileId, (1024 * 500)) == false ){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일 사이즈, 확장자 토탈 검사
|
|
|
|
|
function fn_fileImgTotalCheck(fileId, ext) {
|
|
|
|
|
if($("#"+fileId).val() != ""){
|
|
|
|
|
if(fn_fileExtImgCheck(fileId,ext) == true){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(fn_fileSizeCheck(fileId, (1024 * 500)) == false ){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일 사이즈, 확장자 토탈 검사
|
|
|
|
|
function fn_fileZipTotalCheck(fileId, ext) {
|
|
|
|
|
if($("#"+fileId).val() != ""){
|
|
|
|
|
if(fn_fileExtImgCheck(fileId,ext) == true){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(fn_fileSizeCheck(fileId, (1024 * 500)) == false ){
|
|
|
|
|
fn_fileClear(fileId);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일사이즈 검사
|
|
|
|
|
function fn_fileSizeCheck(id, maxSize) {
|
|
|
|
|
if(fn_getInternetExplorerVersion() > 9){
|
|
|
|
|
if($("#"+id)[0].files[0].size > maxSize){
|
|
|
|
|
alert("첨부 파일 크기는 "+byteConvertor(maxSize)+"보다 작아야 합니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
//단위 변환
|
|
|
|
|
function byteConvertor(bytes) {
|
|
|
|
|
bytes = parseInt(bytes);
|
|
|
|
|
var s = ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
|
|
|
|
|
var e = Math.floor(Math.log(bytes)/Math.log(1024));
|
|
|
|
|
if(e >= s.length) e = s.length - 1;//s의 마지막 단위로 표시할 수 없이 크다면, 마지막 단위로 처리
|
|
|
|
|
|
|
|
|
|
if(e == "-Infinity") return "0 " + s[0];
|
|
|
|
|
else return (bytes/Math.pow(1024, Math.floor(e)))+""+s[e];
|
|
|
|
|
}
|
|
|
|
|
//파일확장자 검사
|
|
|
|
|
function fn_fileExtCheck(id, ext){
|
|
|
|
|
|
|
|
|
|
var re = true;
|
|
|
|
|
var thumbext = document.getElementById(id).value; //파일을 추가한 input 박스의 값
|
|
|
|
|
thumbext = thumbext.slice(thumbext.lastIndexOf(".") + 1).toLowerCase(); //파일 확장자를 잘라내고, 비교를 위해 소문자로 만듬
|
|
|
|
|
|
|
|
|
|
var arr = ext.split(",");
|
|
|
|
|
//20191211 추가 KYS
|
|
|
|
|
// var fileExtChk = thumbext.split('.');
|
|
|
|
|
for(var a=0; a<arr.length; a++){
|
|
|
|
|
if(thumbext == arr[a]){
|
|
|
|
|
re = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(re == true){
|
|
|
|
|
alert("등록할 수 없는 파일입니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//2018-09-10 파일확장자 검사
|
|
|
|
|
function fn_fileExtCheck2(id, ext){
|
|
|
|
|
var re = true;
|
|
|
|
|
var thumbext = document.getElementById(id).value; //파일을 추가한 input 박스의 값
|
|
|
|
|
thumbext = thumbext.slice(thumbext.indexOf(".") ).toLowerCase(); //파일 확장자를 잘라내고, 비교를 위해 소문자로 만듬
|
|
|
|
|
|
|
|
|
|
var arr = ext.split(",");
|
|
|
|
|
//alert("tbumbext =" + thumbext);
|
|
|
|
|
for(var a=0; a<arr.length; a++) {
|
|
|
|
|
//alert(thumbext + " , " + arr[a]);
|
|
|
|
|
if(thumbext == arr[a]){
|
|
|
|
|
re = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(re == true){
|
|
|
|
|
alert("등록할 수 없는 파일입니다");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//2018-09-10 파일확장자 검사
|
|
|
|
|
function fn_fileExtImgCheck(id, ext){
|
|
|
|
|
var re = true;
|
|
|
|
|
var thumbext = document.getElementById(id).value; //파일을 추가한 input 박스의 값
|
|
|
|
|
thumbext = thumbext.slice(thumbext.indexOf(".") ).toLowerCase(); //파일 확장자를 잘라내고, 비교를 위해 소문자로 만듬
|
|
|
|
|
|
|
|
|
|
var arr = ext.split(",");
|
|
|
|
|
//alert("tbumbext =" + thumbext);
|
|
|
|
|
for(var a=0; a<arr.length; a++) {
|
|
|
|
|
//alert(thumbext + " , " + arr[a]);
|
|
|
|
|
if(thumbext == arr[a]){
|
|
|
|
|
re = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(re == true){
|
|
|
|
|
alert("등록가능 한 파일은 " + ext + "입니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return re;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일 Clear
|
|
|
|
|
function fn_fileClear(fileId){
|
|
|
|
|
$("#"+fileId).replaceWith( $("#"+fileId).clone(true));
|
|
|
|
|
}
|
|
|
|
|
//InternetExplorer 버젼 체크
|
|
|
|
|
function fn_getInternetExplorerVersion() {
|
|
|
|
|
var rv = -1;
|
|
|
|
|
if (navigator.appName == 'Microsoft Internet Explorer') {
|
|
|
|
|
var ua = navigator.userAgent;
|
|
|
|
|
var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
|
|
|
|
|
if (re.exec(ua) != null)
|
|
|
|
|
rv = parseFloat(RegExp.$1);
|
|
|
|
|
}
|
|
|
|
|
// 추가 부분
|
|
|
|
|
if (rv < 8) {
|
|
|
|
|
// 호환성 보기 모드에서는 버젼 체크가 제데로 안됨.
|
|
|
|
|
//익스플로러 8 미만으로 나올 경우 Trident 값을 한번 더 체크
|
|
|
|
|
var trident = navigator.userAgent.match(/Trident\/(\d.\d)/i);
|
|
|
|
|
if (trident != null) {
|
|
|
|
|
// 버전 8이상이면 trident 값이 null 이 아님..
|
|
|
|
|
rv = trident[1]*1 + 4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//크롬
|
|
|
|
|
if(navigator.appName == "Netscape"){
|
|
|
|
|
rv = 10;
|
|
|
|
|
}
|
|
|
|
|
return rv;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------------------------------------ 파일 체크관련 끝
|
|
|
|
|
|
|
|
|
|
//값 범위
|
|
|
|
|
function fn_checkRange(value, sValue, eValue, title, colIndex, rowIndex, grid){
|
|
|
|
|
if(value< sValue || value > eValue){
|
|
|
|
|
alert(title+"값의 범위는 "+sValue+"~"+eValue+"입니다.");
|
|
|
|
|
return title+"값의 범위는 "+sValue+"~"+eValue+"입니다.";
|
|
|
|
|
setEditedItemPosition(colIndex, rowIndex , grid);
|
|
|
|
|
}else{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//열추가
|
|
|
|
|
function fn_ColAdd(layoutStart, layoutEnd, colCount, rowCount, startIndex, gridApp, gridRoot, type){
|
|
|
|
|
var layoutStr = "";
|
|
|
|
|
if(colCount>=startIndex){
|
|
|
|
|
layoutStr = "";
|
|
|
|
|
//layout
|
|
|
|
|
for(var i=1; i<=colCount-(startIndex-1); i++){
|
|
|
|
|
layoutStr = layoutStr + '\<DataGridColumn width="100" id="VALUE'+i+'" dataField="VALUE'+i+'" textAlign="left" resizable="false" />\
|
|
|
|
|
';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//data
|
|
|
|
|
if(type == "number"){
|
|
|
|
|
changeItem(colCount-(startIndex-1), 0, "VALUE"+(colCount-(startIndex-1)), gridRoot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(var i=1; i<rowCount; i++){
|
|
|
|
|
changeItem("", i, "VALUE"+(colCount-(startIndex-1)) , gridRoot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//set
|
|
|
|
|
gridApp.setLayout(layoutStart+layoutStr+layoutEnd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//열삭제
|
|
|
|
|
function fn_ColDel(colCount,rowCount, startIndex, layoutStart, layoutEnd, gridApp, gridRoot){
|
|
|
|
|
var layoutStr = "";
|
|
|
|
|
if(colCount>startIndex){
|
|
|
|
|
layoutStr = "";
|
|
|
|
|
|
|
|
|
|
//layout
|
|
|
|
|
for(var i=1; i<=colCount-(startIndex+1); i++){
|
|
|
|
|
layoutStr = layoutStr + '\<DataGridColumn width="100" id="VALUE'+i+'" dataField="VALUE'+i+'" textAlign="left" resizable="false" />\
|
|
|
|
|
';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//data
|
|
|
|
|
for(var i=0; i<rowCount; i++){
|
|
|
|
|
changeItem("", i, "VALUE"+(colCount-startIndex), gridRoot);
|
|
|
|
|
}
|
|
|
|
|
//set
|
|
|
|
|
gridApp.setLayout(layoutStart+layoutStr+layoutEnd);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//이미지 파일업로드 display관리 (열추가일 경우)
|
|
|
|
|
function fn_FileDisplayCol(columnIndex, colCount, currentKey, id, gridRoot , keyRowIndex){
|
|
|
|
|
if(document.getElementById(id+currentKey) != null){
|
|
|
|
|
document.getElementById(id+currentKey).style.display = "";
|
|
|
|
|
|
|
|
|
|
for(var i=1; i<colCount; i++){
|
|
|
|
|
if(i != columnIndex){
|
|
|
|
|
var key = gridRoot.getItemFieldAt(keyRowIndex, "VALUE"+i);
|
|
|
|
|
document.getElementById(id+key).style.display = "none";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//첨부파일 row 동적생성
|
|
|
|
|
function fn_FileAddRow(tableId, file_key, file_id, tr_id, desc){
|
|
|
|
|
|
|
|
|
|
/*var strHtml = "<tr id=\""+tr_id+file_key+"\" >";
|
|
|
|
|
strHtml += " <td class=\"g_box_left\">"+desc+"</td>";
|
|
|
|
|
strHtml += " <td class=\"plus_file\" colspan=\"3\"><input type=\"file\" id=\""+file_id+file_key+"\" name=\""+file_id+file_key+"\" style=\"width:350px; height:22px\" /></td>";
|
|
|
|
|
strHtml += "</tr>";*/
|
|
|
|
|
|
|
|
|
|
var strHtml = "<div id=\""+tr_id+file_key+"\" class='table-file-wrapper'>";
|
|
|
|
|
strHtml += " <div class='contents-title-1depth marT20'><span>"+desc+"를(을) 입력하세요. (최대크기: 500KB)</span></div>";
|
|
|
|
|
strHtml += " <table class='table table-file marT0' data-target='form-file'>";
|
|
|
|
|
strHtml += " <colgroup>";
|
|
|
|
|
strHtml += " <col width='160px'>";
|
|
|
|
|
strHtml += " <col width='auto'>";
|
|
|
|
|
strHtml += " </colgroup>";
|
|
|
|
|
strHtml += " <tr>";
|
|
|
|
|
strHtml += " <td class=\"td-head\">첨부파일입력</td>";
|
|
|
|
|
strHtml += " <td class=\"plus_file\" colspan=\"3\">";
|
|
|
|
|
strHtml += " <input type=\"file\" id=\""+file_id+file_key+"\" name=\""+file_id+file_key+"\" class=\"gg-input file-input\" />";
|
|
|
|
|
strHtml += " <ul class=\"content-ul-list marT5\">";
|
|
|
|
|
strHtml += " <li>"+desc+"는(은) <span class=\"textR\">필수입력</span>입니다.</li>";
|
|
|
|
|
strHtml += " <li>파일크기는 \"최대 500KB\" 입니다.</li>";
|
|
|
|
|
strHtml += " </ul>";
|
|
|
|
|
strHtml += " </td>";
|
|
|
|
|
strHtml += " </tr>";
|
|
|
|
|
strHtml += " </table>";
|
|
|
|
|
strHtml += "</div>";
|
|
|
|
|
|
|
|
|
|
$("#"+tableId).append(strHtml);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//첨부파일 row 동적삭제
|
|
|
|
|
function fn_FileRemoveRow(tableId, rowIndex, num){
|
|
|
|
|
|
|
|
|
|
debugger;
|
|
|
|
|
var objTable = document.getElementById(tableId);
|
|
|
|
|
|
|
|
|
|
//현재 로우가 있을경우만 삭제 가능
|
|
|
|
|
if(objTable.rows.length > 0){
|
|
|
|
|
for(var i=1; i<=num; i++){
|
|
|
|
|
objTable.deleteRow(rowIndex-i);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//첨부파일 row 동적생성
|
|
|
|
|
function fn_FileAddRow2(tableId, file_key, file_id, tr_id, desc, rowCount, reNameYN){
|
|
|
|
|
var beforeTrId = tr_id+(file_key-1);
|
|
|
|
|
var trId = tr_id+file_key; //TR ID
|
|
|
|
|
var fileId = file_id+file_key; //FILE ID
|
|
|
|
|
|
|
|
|
|
var strHtml = "<div id=\""+trId+"\" class='table-file-wrapper'>";
|
|
|
|
|
strHtml += " <div class='contents-title-1depth marT20'><span>"+desc+"를(을) 입력하세요. (최대크기: 500KB)</span></div>";
|
|
|
|
|
strHtml += " <table class='table table-file marT0' data-target='form-file'>";
|
|
|
|
|
strHtml += " <colgroup>";
|
|
|
|
|
strHtml += " <col width='160px'>";
|
|
|
|
|
strHtml += " <col width='auto'>";
|
|
|
|
|
strHtml += " </colgroup>";
|
|
|
|
|
strHtml += " <tr>";
|
|
|
|
|
strHtml += " <td class=\"td-head\">첨부파일입력</td>";
|
|
|
|
|
strHtml += " <td class=\"plus_file\" colspan=\"3\">";
|
|
|
|
|
strHtml += " <input type=\"file\" id=\""+fileId+"\" name=\""+fileId+"\" class=\"gg-input file-input\" />";
|
|
|
|
|
strHtml += " <input type=\"hidden\" id=\"OLD_GRAPH_LOCAL_"+file_key+"\" name=\"OLD_GRAPH_LOCAL_"+file_key+"\" class=\"trViewOff\" value=\"\" />";
|
|
|
|
|
strHtml += " <input type=\"hidden\" id=\"OLD_GRAPH_IMAGE_"+file_key+"\" name=\"OLD_GRAPH_IMAGE_"+file_key+"\" class=\"trViewOff\" value=\"\" />";
|
|
|
|
|
/*strHtml += " <input type=\"checkbox\" id=\"FILE_DEL_"+file_key+"\" name=\"FILE_DEL_"+file_key+"\" class=\"trViewOff\" value=\"Y\" />";*/
|
|
|
|
|
strHtml += " <ul class=\"content-ul-list marT5\">";
|
|
|
|
|
strHtml += " <li>"+desc+"는(은) <span class=\"textR\">필수입력</span>입니다.</li>";
|
|
|
|
|
strHtml += " <li>파일크기는 \"최대 500KB\" 입니다.</li>";
|
|
|
|
|
strHtml += " </ul>";
|
|
|
|
|
strHtml += " </td>";
|
|
|
|
|
strHtml += " </tr>";
|
|
|
|
|
strHtml += " </table>";
|
|
|
|
|
strHtml += "</div>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 그리드에서도 추가는 선택한 row 다음에 추가 되어야 하므로. 파일도 동일하게 적용.
|
|
|
|
|
if((file_key-1) > 0){
|
|
|
|
|
$("#"+tableId).find("#"+beforeTrId).eq(0).after(strHtml);
|
|
|
|
|
}else{
|
|
|
|
|
$("#"+tableId).eq(-1).append(strHtml); // 처음 추가 했을 때 추가.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(reNameYN == null || reNameYN == "undefined" || reNameYN == ""){
|
|
|
|
|
// ID 재정의
|
|
|
|
|
fn_FileReName();
|
|
|
|
|
}
|
|
|
|
|
// display controll
|
|
|
|
|
fn_FileDisplayRow(file_key, tableId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//실제 물리적인 파일 삭제 하기 위해 파일명 Arr
|
|
|
|
|
var rowDelFileArr = "";
|
|
|
|
|
|
|
|
|
|
//첨부파일 row 동적삭제
|
|
|
|
|
function fn_FileRemoveRow2(tableId, scode, rowCount, reNameYN){
|
|
|
|
|
//실제 물리적인 파일 삭제 하기 위해 파일명 Arr
|
|
|
|
|
rowDelFileArr += $("#OLD_GRAPH_IMAGE_"+scode).val() + ",";
|
|
|
|
|
|
|
|
|
|
$("#TR_GRAPH_IMAGE_"+scode).remove();
|
|
|
|
|
if(rowCount > 0){
|
|
|
|
|
$("#"+tableId).find(".table-file-wrapper").addClass("trViewOff"); //일단 모두 안보이게
|
|
|
|
|
|
|
|
|
|
if(reNameYN == null || reNameYN == "undefined" || reNameYN == ""){
|
|
|
|
|
// ID 재정의
|
|
|
|
|
fn_FileReName();
|
|
|
|
|
}
|
|
|
|
|
$("#"+tableId).find(".table-file-wrapper").eq(0).removeClass("trViewOff"); //처음 Row에 해당하는 파일첨부 보이기.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//이미지 파일업로드 display관리 (행추가일 경우)
|
|
|
|
|
function fn_FileDisplayRow(scode, tableId){
|
|
|
|
|
if(tableId == null || tableId == "undefined" || tableId == ""){
|
|
|
|
|
$("#table_file").find(".table-file-wrapper").addClass("trViewOff"); //일단 모두 안보이게
|
|
|
|
|
}else{
|
|
|
|
|
$("#"+tableId).find(".table-file-wrapper").addClass("trViewOff"); //일단 모두 안보이게
|
|
|
|
|
}
|
|
|
|
|
$("#TR_GRAPH_IMAGE_"+scode).removeClass("trViewOff"); //Row에 해당하는 파일첨부 보이기.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function fn_FileReName(){
|
|
|
|
|
// tr ID 재정의
|
|
|
|
|
$("#table_file").find("tr").attr("id", function (arr) {
|
|
|
|
|
return "TR_GRAPH_IMAGE_" + (arr+1);
|
|
|
|
|
});
|
|
|
|
|
//Input file명에도 Id Name 변경.
|
|
|
|
|
$("input:file").attr({
|
|
|
|
|
"id" : function (arr) { return "GRAPH_IMAGE_" + (arr+1); }
|
|
|
|
|
,"name" : function (arr) { return "GRAPH_IMAGE_" + (arr+1); }
|
|
|
|
|
});
|
|
|
|
|
//Input Delete명에도 Id Name 변경.
|
|
|
|
|
$("input:checkbox").attr({
|
|
|
|
|
"id" : function (arr) { return "FILE_DEL_" + (arr+1); }
|
|
|
|
|
,"name" : function (arr) { return "FILE_DEL_" + (arr+1); }
|
|
|
|
|
});
|
|
|
|
|
//기존파일명에도 Id Name 변경.
|
|
|
|
|
$('input[name^="OLD_GRAPH_IMAGE_"]').attr({
|
|
|
|
|
"id" : function (arr) { return "OLD_GRAPH_IMAGE_" + (arr+1); }
|
|
|
|
|
,"name" : function (arr) { return "OLD_GRAPH_IMAGE_" + (arr+1); }
|
|
|
|
|
});
|
|
|
|
|
$('input[name^="OLD_GRAPH_LOCAL_"]').attr({
|
|
|
|
|
"id" : function (arr) { return "OLD_GRAPH_LOCAL_" + (arr+1); }
|
|
|
|
|
,"name" : function (arr) { return "OLD_GRAPH_LOCAL_" + (arr+1); }
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//그리드 변경여부
|
|
|
|
|
function Is_GridUpdate(gridRoot){
|
|
|
|
|
var changedDataXML = gridRoot.getChangedDataXML();
|
|
|
|
|
if (changedDataXML == null) {
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//SEQ 큰번호 추출
|
|
|
|
|
function fn_getMaxSeq(gridRoot, id){
|
|
|
|
|
|
|
|
|
|
//row수
|
|
|
|
|
var col = gridRoot.getCollection();
|
|
|
|
|
var rowCount = col.getLength();
|
|
|
|
|
var key1 = "";
|
|
|
|
|
var key2 = "";
|
|
|
|
|
var maxkey = 0;
|
|
|
|
|
|
|
|
|
|
if(rowCount > 0){
|
|
|
|
|
|
|
|
|
|
maxkey = gridRoot.getItemFieldAt(0, id);
|
|
|
|
|
|
|
|
|
|
for(var j=0; j<rowCount; j++){
|
|
|
|
|
key2 = gridRoot.getItemFieldAt(j, id);
|
|
|
|
|
|
|
|
|
|
if(Number(maxkey) >= Number(key2)){
|
|
|
|
|
maxkey = maxkey;
|
|
|
|
|
}else{
|
|
|
|
|
maxkey = key2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return maxkey;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TR 추가 (행추가) (SEQ)
|
|
|
|
|
function fn_gridAddRow(trId, fileId, seq, desc){
|
|
|
|
|
|
|
|
|
|
var strHtml = "<div class=\"contents-title-1depth marT20\"><span>"+desc+"</span></div>";
|
|
|
|
|
strHtml += "<table class=\"table table-file marT0\" data-target=\"form-file\">";
|
|
|
|
|
strHtml += " <colgroup>";
|
|
|
|
|
strHtml += " <col width=\"160px\" />";
|
|
|
|
|
strHtml += " <col width=\"auto\" />";
|
|
|
|
|
strHtml += " </colgroup>";
|
|
|
|
|
strHtml += " <tbody id=\""+trId+seq+"\">";
|
|
|
|
|
strHtml += " <tr>";
|
|
|
|
|
strHtml += " <td class=\"td-head\">첨부파일입력</td>";
|
|
|
|
|
strHtml += " <td class=\"plus_file\" colspan=\"3\">";
|
|
|
|
|
strHtml += " <input type=\"file\" id=\""+fileId+seq+"\" name=\""+fileId+seq+"\" class=\"gg-input file-input\" />";
|
|
|
|
|
strHtml += " <ul class=\"content-ul-list marT5\">";
|
|
|
|
|
strHtml += " <li>시험결과 그래프는 <span class=\"textR\">필수입력</span>입니다.</li>";
|
|
|
|
|
strHtml += " <li>파일크기는 \"최대 500KB\" 입니다.</li>";
|
|
|
|
|
strHtml += " </ul>";
|
|
|
|
|
strHtml += " <input type=\"hidden\" id=\"OLD_GRAPH_IMAGE_"+seq+"\" name=\"OLD_GRAPH_IMAGE_"+seq+"\" class=\"trViewOff\" value=\"\" />";
|
|
|
|
|
strHtml += " <input type=\"hidden\" id=\"OLD_GRAPH_LOCAL_"+seq+"\" name=\"OLD_GRAPH_LOCAL_"+seq+"\" class=\"trViewOff\" value=\"\" />";
|
|
|
|
|
strHtml += " <input type=\"checkbox\" id=\"FILE_DEL_"+seq+"\" name=\"FILE_DEL_"+seq+"\" class=\"trViewOff\" value=\"Y\" />";
|
|
|
|
|
strHtml += " </td>";
|
|
|
|
|
strHtml += " </tr>";
|
|
|
|
|
strHtml += " </tbody>";
|
|
|
|
|
strHtml += "</table>";
|
|
|
|
|
|
|
|
|
|
$("#table_file").append(strHtml);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//TR 삭제 (행삭제) (SEQ)
|
|
|
|
|
function fn_gridDelRow(seq){
|
|
|
|
|
//실제 물리적인 파일 삭제 하기 위해 파일명 Arr
|
|
|
|
|
rowDelFileArr += $("#OLD_GRAPH_IMAGE_"+seq).val() + ",";
|
|
|
|
|
|
|
|
|
|
$("#TR_GRAPH_IMAGE_"+seq).remove();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//KEY 중복 막기
|
|
|
|
|
function fn_checkKey(gridRoot,id, columnNm, columnIndex, gridNm, dataGrid){
|
|
|
|
|
//row수
|
|
|
|
|
var col = gridRoot.getCollection();
|
|
|
|
|
var rowCount = col.getLength();
|
|
|
|
|
var key1 = "";
|
|
|
|
|
var key2 = "";
|
|
|
|
|
var status = "";
|
|
|
|
|
|
|
|
|
|
if(rowCount > 0){
|
|
|
|
|
|
|
|
|
|
key1 = gridRoot.getItemFieldAt(0, id);
|
|
|
|
|
for(var i=0; i<rowCount; i++){
|
|
|
|
|
key1 = gridRoot.getItemFieldAt(i, id);
|
|
|
|
|
|
|
|
|
|
for(var j=1; j<rowCount; j++){
|
|
|
|
|
key2 = gridRoot.getItemFieldAt(j, id);
|
|
|
|
|
|
|
|
|
|
if(key1 == key2 && i!= j){
|
|
|
|
|
alert(columnNm+"(은/는) 값이 중복될 수 없습니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일 수정한 여부 확인
|
|
|
|
|
function Is_FileUpdate(gridRoot,id,rowCount,fileId,filedelId){
|
|
|
|
|
//파일 수정한 건 있는지
|
|
|
|
|
for(var f = 0; f < rowCount; f++){
|
|
|
|
|
var scode = gridRoot.getItemFieldAt(f, id);
|
|
|
|
|
|
|
|
|
|
if(document.getElementById(fileId+(scode)).value != ""){
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var frm = document.getElementById("OLD_"+fileId+(scode));
|
|
|
|
|
if(frm != null && frm != "" && frm != "undefined"){
|
|
|
|
|
var old_val = document.getElementById("OLD_"+fileId+(scode)).value;
|
|
|
|
|
if(old_val != "" && old_val != "null" && old_val != "undefined"){
|
|
|
|
|
if(document.getElementById(filedelId+(scode)).checked == true){
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일 수정한 여부 확인 (1건)
|
|
|
|
|
function Is_FileUpdateOne(fileId, key, filedelId){
|
|
|
|
|
|
|
|
|
|
//파일 수정한 건 있는지
|
|
|
|
|
var file = document.getElementById(fileId+(key));
|
|
|
|
|
if(file != null && file != "" && file != "undefined"){
|
|
|
|
|
if(document.getElementById(fileId+(key)).value != ""){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//파일삭제 체크
|
|
|
|
|
var frm = document.getElementById("OLD_"+fileId+(key));
|
|
|
|
|
if(frm != null && frm != "" && frm != "undefined"){
|
|
|
|
|
if(document.getElementById("OLD_"+fileId+(key)).value != ""){
|
|
|
|
|
if(document.getElementById(filedelId+(key)).checked == true){
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//파일 수정한 여부 확인
|
|
|
|
|
function Is_FileUpdateCols(gridRoot,id,keyIndex, colCount,startIndex,fileId,filedelId){
|
|
|
|
|
//파일 수정한 건 있는지
|
|
|
|
|
for(var f = 0; f < colCount-startIndex; f++){
|
|
|
|
|
var scode = gridRoot.getItemFieldAt(keyIndex, "VALUE"+(f+1));
|
|
|
|
|
var frmFile = document.getElementById(fileId+(scode));
|
|
|
|
|
|
|
|
|
|
if(frmFile != null && frmFile != "" && frmFile != "undefined"){
|
|
|
|
|
if(document.getElementById(fileId+(scode)).value != ""){
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var frm = document.getElementById("OLD_"+fileId+(scode));
|
|
|
|
|
if(frm != null && frm != "" && frm != "undefined"){
|
|
|
|
|
if(document.getElementById("OLD_"+fileId+(scode)).value != ""){
|
|
|
|
|
if(document.getElementById(filedelId+(scode)).checked == true){
|
|
|
|
|
return true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//저장 안할 경우 파일 다시 선택 한 내용에 대해 clear 처리.
|
|
|
|
|
function Is_FileUpdateClear(gridRoot,id,rowCount,fileId,filedelId){
|
|
|
|
|
//파일 수정한 건 있는지
|
|
|
|
|
for(var f = 0; f < rowCount; f++){
|
|
|
|
|
var scode = gridRoot.getItemFieldAt(f, id);
|
|
|
|
|
|
|
|
|
|
if($("#"+fileId+(scode)).val() != ""){
|
|
|
|
|
$("#"+fileId+(scode)).replaceWith( $("#"+fileId+(scode)).clone(true));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//이미지 확대
|
|
|
|
|
function fn_imgPlus(path,top,left){
|
|
|
|
|
var topIndex = 0;
|
|
|
|
|
|
|
|
|
|
//스크린 중간보다 아래일경우
|
|
|
|
|
var size = top -screen.height/2;
|
|
|
|
|
if(size > 0){
|
|
|
|
|
topIndex = top - 500 + size;
|
|
|
|
|
}else{
|
|
|
|
|
topIndex = top;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var option =",toobar=no,location=no,menubar=no,status=no, scrollbars=yes";
|
|
|
|
|
var graphWin = window.open("/com/graphPopup.do?imgPath="+path,"Calendar","width=500, height=500px, top=50px, left=100px "+option);
|
|
|
|
|
if(graphWin != null) graphWin.focus();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//숫자
|
|
|
|
|
function fn_onkeyNumber(id, mode){
|
|
|
|
|
$("#"+id).keyup(function(event){
|
|
|
|
|
if (!(event.keyCode >=37 && event.keyCode<=40)) {
|
|
|
|
|
var inputVal = $(this).val();
|
|
|
|
|
if(mode == "int"){
|
|
|
|
|
$(this).val(inputVal.replace(/[^0-9]/gi,''));
|
|
|
|
|
}else if(mode=="float"){
|
|
|
|
|
$(this).val(inputVal.replace(/[^0-9.]/gi,''));
|
|
|
|
|
}else if(mode=="float02"){
|
|
|
|
|
$(this).val(inputVal.replace(/[^0-9.-]/gi,''));
|
|
|
|
|
}else if(mode=="phone"){
|
|
|
|
|
$(this).val(inputVal.replace(/[^0-9-]/gi,''));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//KEY 중복 막기
|
|
|
|
|
function fn_checkKeyHtml(id, keyid, columnNm){
|
|
|
|
|
//row수
|
|
|
|
|
var objTable = document.getElementById(id);
|
|
|
|
|
var rowCount = objTable.rows.length;
|
|
|
|
|
|
|
|
|
|
var key1 = "";
|
|
|
|
|
var key2 = "";
|
|
|
|
|
var status = "";
|
|
|
|
|
|
|
|
|
|
if(rowCount > 0){
|
|
|
|
|
|
|
|
|
|
key1 = $("#"+keyid+"1").val();
|
|
|
|
|
for(var i=1; i<=rowCount; i++){
|
|
|
|
|
key1 = $("#"+keyid+(i)).val();
|
|
|
|
|
|
|
|
|
|
for(var j=1; j<rowCount; j++){
|
|
|
|
|
key2 = $("#"+keyid+(j)).val();
|
|
|
|
|
|
|
|
|
|
if(key1 == key2 && i!= j){
|
|
|
|
|
alert(columnNm+"(은/는) 값이 중복될 수 없습니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
$("#"+keyid+(j)).focus();
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 그리드 로우 헤더 변경.
|
|
|
|
|
function fn_gridHeaderTextChange(gridRoot, id, text){
|
|
|
|
|
//fn_gridHeaderTextChange(gridRoot,'LAYER_ENG_NAME','TEST!'); //사용방법
|
|
|
|
|
|
|
|
|
|
var column = gridRoot.getObjectById(id);
|
|
|
|
|
if(column == null){
|
|
|
|
|
var arrStr = id.split("_");
|
|
|
|
|
if(arrStr.length == 2){
|
|
|
|
|
id = arrStr[0].toLowerCase() + arrStr[1][0] + arrStr[1].substring(1).toLowerCase();
|
|
|
|
|
}
|
|
|
|
|
if(arrStr.length == 3){
|
|
|
|
|
id = arrStr[0].toLowerCase() + arrStr[1][0] + arrStr[1].substring(1).toLowerCase() + arrStr[2][0] + arrStr[2].substring(1).toLowerCase();
|
|
|
|
|
}
|
|
|
|
|
if(arrStr.length == 4){
|
|
|
|
|
id = arrStr[0].toLowerCase() + arrStr[1][0] + arrStr[1].substring(1).toLowerCase() + arrStr[2][0] + arrStr[2].substring(1).toLowerCase() + arrStr[3][0] + arrStr[3].substring(1).toLowerCase();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
column = gridRoot.getObjectById(id);
|
|
|
|
|
}
|
|
|
|
|
column.setHeaderText(text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 그리드 컬럼 헤더 변경
|
|
|
|
|
function fn_gridColHeaderTextChange(gridData, text, rowNum, colNum){
|
|
|
|
|
//gridRoot.setItemFieldAt(text, rowNum, 'TITLE'+colNum); //값을 바꾸는 경우
|
|
|
|
|
gridData[rowNum]['TITLE'+colNum] = text; //처음에 셋팅 하기전에 title 설정.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//기준계 팝업 -- reference_code페이지에서 로컬로 사용. -- 추후삭제
|
|
|
|
|
/*
|
|
|
|
|
function fn_referenceDiv(chkId,divId){
|
|
|
|
|
if(chkId == "SAMPLE_INFO"){$("#"+chkId).attr("checked",true);} //기본물성시험은 무조건 checked
|
|
|
|
|
|
|
|
|
|
if($("#"+chkId).is(":checked") == true){
|
|
|
|
|
var chk = $("#"+chkId);
|
|
|
|
|
var chkPosition = chk.position();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'post',
|
|
|
|
|
url : '/web/common/reference_code.jsp?TEST_INFO_CODE='+chkId,
|
|
|
|
|
async : false,
|
|
|
|
|
data : {},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert('Unknown error ' + status);
|
|
|
|
|
},
|
|
|
|
|
success : function(data) {
|
|
|
|
|
$("#"+ divId).css({'top' : 70, 'left' : 380});
|
|
|
|
|
$("#"+ divId).removeClass("trViewOff");
|
|
|
|
|
$("#"+ divId).html(data);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//div 크기에 따라 크면
|
|
|
|
|
//setTimeout("fn_divHeightChange('"+divId+"');",100);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
function fn_divHeightChange(divId){
|
|
|
|
|
var divHeight = $("#"+ divId).height();
|
|
|
|
|
if(divHeight > 450){
|
|
|
|
|
$("#"+ divId).css("height","450px");
|
|
|
|
|
}else{
|
|
|
|
|
$("#"+ divId).css("height",divHeight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//저장클릭 시, 숫자관련 길이 제한 (GRID)
|
|
|
|
|
//type : COL, ROW 종류
|
|
|
|
|
//fn_saveNumberCheck("ROW",gridRoot, dataGrid, "grid1", 0, rowInfo(배열));
|
|
|
|
|
//fn_saveNumberCheck("COL",gridRoot, dataGrid, "grid1", 1, colInfo(배열));
|
|
|
|
|
function fn_saveNumberCheck(type, gridRoot, dataGrid, grid, startIndex, item){
|
|
|
|
|
|
|
|
|
|
//RowCount
|
|
|
|
|
var collection = gridRoot.getCollection();
|
|
|
|
|
var rowCount = collection.getLength();
|
|
|
|
|
|
|
|
|
|
//ColCount
|
|
|
|
|
var colCount = dataGrid.getColumnCount();
|
|
|
|
|
|
|
|
|
|
//COL
|
|
|
|
|
if(type == "COL"){
|
|
|
|
|
//Row 검사
|
|
|
|
|
for(var r=0; r<rowCount; r++){
|
|
|
|
|
|
|
|
|
|
for(var i=startIndex; i<colCount; i++){
|
|
|
|
|
if(item[r+"_idx"] != undefined){
|
|
|
|
|
if(item[r+"_idx"] == r){
|
|
|
|
|
var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
|
|
|
|
|
//자리수 체크
|
|
|
|
|
var val = gridRoot.getItemFieldAt(r, dataField);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(fn_isNull(val) != "" && (is_float(val,Number(item[r+"_start_num"]),Number(item[r+"_end_num"])) == false || is_numberRange(val,Number(item[r+"_start_num"]),Number(item[r+"_end_num"])) == false )){
|
|
|
|
|
alert(item[r+"_title"] + "값의 범위를 확인하시기 바랍니다. ([1]정수 : "+item[r+"_start_num"]+"자리, 소수점 이하 : "+ item[r+"_end_num"]+"자리)");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2017.10.17 dhlee 공백검사
|
|
|
|
|
if( (item[r+"_title"].indexOf("To") > -1) || (item[r+"_title"].indexOf("From") > -1) ){
|
|
|
|
|
if( val == '' || val == null || val == 'null' ){
|
|
|
|
|
if( isNaN(val) ){
|
|
|
|
|
alert(item[r+"_title"] + "의 값이 입력되지 않았습니다 입력후 저장 바랍니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2017.10.17 dhlee 심도값 중복여부 확인 추가
|
|
|
|
|
// 현재 검사하는 심도의 from 값과 이전 심도의 To 값을 비교하여 현재의from값이 이전심도의 To값보다 작다면 에러
|
|
|
|
|
if(item[r+"_title"].indexOf("From") > -1 && i > startIndex){
|
|
|
|
|
var column = dataGrid.getColumns()[i-1];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val2 = gridRoot.getItemFieldAt(r+1, dataField);
|
|
|
|
|
|
|
|
|
|
if(fn_isNull(val) == "" || fn_isNull(val2) == "" || Number(val2) > Number(val) ){
|
|
|
|
|
alert(item[r+"_title"] + "에 입력값이 이전에 입력된 심도(To)(m) 값보다 크거나 잘못된 값이 입력되었습니다. 확인바랍니다. ");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// To의 값이 From의 값보다 클 경우
|
|
|
|
|
if(item[r+"_title"].indexOf("To") > -1){
|
|
|
|
|
var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val2 = gridRoot.getItemFieldAt(r-1, dataField);
|
|
|
|
|
|
|
|
|
|
if(fn_isNull(val) == "" || fn_isNull(val2) == "" || Number(val2) >= Number(val) ){
|
|
|
|
|
alert(item[r+"_title"]+"에 입력된 값이 이전에 입력된 심도(From)(m) 값보다 크거나 잘못된 값이 입력되었습니다. 확인바랍니다. ");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ROW
|
|
|
|
|
if(type == "ROW"){
|
|
|
|
|
for(var i=0; i<colCount; i++){
|
|
|
|
|
for(var r=0; r<rowCount; r++){
|
|
|
|
|
if(item[i+"_idx"] != undefined){
|
|
|
|
|
if(item[i+"_idx"] == i){
|
|
|
|
|
//컬럼정보
|
|
|
|
|
var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var title = gridRoot.getObjectById(dataField).getHeaderText().replace("<br>",""); //헤더 텍스트
|
|
|
|
|
|
|
|
|
|
//자리수 체크
|
|
|
|
|
var val = gridRoot.getItemFieldAt(r, dataField);
|
|
|
|
|
if(fn_isNull(val) != "" && (is_float(val,Number(item[i+"_start_num"]),Number(item[i+"_end_num"])) == false || is_numberRange(val,Number(item[i+"_start_num"]),Number(item[i+"_end_num"])) == false )){
|
|
|
|
|
alert(title + "값의 범위를 확인하시기 바랍니다. ([2]정수 : "+item[i+"_start_num"]+"자리, 소수점 이하 : "+ item[i+"_end_num"]+"자리)");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// From(m) 경우,
|
|
|
|
|
var temp = dataField.toUpperCase();
|
|
|
|
|
if( temp.indexOf("DEPTH") > -1 && temp.indexOf("FROM") > -1){
|
|
|
|
|
val = fn_isNull(val);
|
|
|
|
|
if( val == '' || val == null || val == 'null' ){
|
|
|
|
|
//if( val == 0 )
|
|
|
|
|
// continue;
|
|
|
|
|
|
|
|
|
|
alert(title + "의 값이 입력되지 않았습니다. 확인 후 다시 저장 바랍니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
if( r == 0){
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
} else {
|
|
|
|
|
setEditedItemPosition2(i+1, r-1 , grid, dataGrid);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* var column = dataGrid.getColumns()[i-1];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val2 = gridRoot.getItemFieldAt(r+1, dataField);
|
|
|
|
|
|
|
|
|
|
if( val != '' && val != null && val != 'null' ){
|
|
|
|
|
// 2017.10.17 dhlee 심도값 중복여부 확인 추가
|
|
|
|
|
// 현재 검사하는 심도의 from 값과 이전 심도의 To 값을 비교하여 현재의from값이 이전심도의 To값보다 작다면 에러
|
|
|
|
|
if( Number(val2) > Number(val) ){
|
|
|
|
|
alert(item[r+"_title"] + "에 입력값이 이전에 입력된 심도(To)(m) 값보다 크거나 잘못된 값이 입력되었습니다. 확인바랍니다. ");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2017.10.17 dhlee 공백검사
|
|
|
|
|
// To(m) 경우,
|
|
|
|
|
if( temp.indexOf("DEPTH") > -1 && temp.indexOf("TO") > -1){
|
|
|
|
|
val = fn_isNull(val);
|
|
|
|
|
if( val == '' || val == null || val == 'null' ){
|
|
|
|
|
//if( val == 0 )
|
|
|
|
|
// continue;
|
|
|
|
|
|
|
|
|
|
alert(title + "의 값이 입력되지 않았습니다. 확인 후 다시 저장 바랍니다.");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val2 = gridRoot.getItemFieldAt(r-1, dataField);
|
|
|
|
|
|
|
|
|
|
// To의 값이 From의 값보다 클 경우
|
|
|
|
|
if(fn_isNull(val) == "" || fn_isNull(val2) == "" || Number(val2) >= Number(val) ){
|
|
|
|
|
alert(item[r+"_title"]+"에 입력된 값이 이전에 입력된 심도(From)(m) 값보다 크거나 잘못된 값이 입력되었습니다. 확인바랍니다. ");
|
|
|
|
|
fn_progressbarHide(); //ProgressbarHide
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//자리수 체크 함수
|
|
|
|
|
function is_float(v,start_num, end_num) {
|
|
|
|
|
|
|
|
|
|
//var reg=new RegExp("^[0-9]{1,"+start_num+"}(.[0-9]{0,"+end_num+"})$");
|
|
|
|
|
//return reg.test(v);
|
|
|
|
|
|
|
|
|
|
var reg=new RegExp("^\-{0,1}[0-9]{1,"+start_num+"}(.[0-9]{0,"+end_num+"})?$");
|
|
|
|
|
var returnState = false;
|
|
|
|
|
|
|
|
|
|
var arr_v;
|
|
|
|
|
v = v.toString();
|
|
|
|
|
|
|
|
|
|
if(v.search("1e-") == 0 || v.search("1e-") == 1){
|
|
|
|
|
sV = v.split("1e-");
|
|
|
|
|
cV = Number(v).toFixed(sV[1]);
|
|
|
|
|
v = cV.toString();
|
|
|
|
|
arr_v = cV.toString().split('.');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
arr_v = v.toString().split('.');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var fixedNum = end_num;
|
|
|
|
|
if (arr_v[1]) {
|
|
|
|
|
|
|
|
|
|
fixedNum = arr_v[1].length;
|
|
|
|
|
} else {
|
|
|
|
|
fixedNum = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reg.test(v)) {
|
|
|
|
|
var _tmp = parseFloat(v).toFixed(fixedNum);
|
|
|
|
|
if (_tmp.toString() == v){
|
|
|
|
|
returnState = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return returnState;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//값의 범위 체크
|
|
|
|
|
function is_numberRange(v,start_num, end_num) {
|
|
|
|
|
var t = Number(fn_setNine(start_num)+"."+fn_setNine(end_num));
|
|
|
|
|
|
|
|
|
|
if(v > t){
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//숫자 생성
|
|
|
|
|
function fn_setNine(num){
|
|
|
|
|
var a = "";
|
|
|
|
|
|
|
|
|
|
if(num == 0)a="0";
|
|
|
|
|
for(var i=0; i<num; i++){
|
|
|
|
|
a = a + "9";
|
|
|
|
|
}
|
|
|
|
|
return Number(a);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//숫자 입력시 길이제한 HTML
|
|
|
|
|
function fn_saveNumberCheckHTML(item){
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<item.length; i++){
|
|
|
|
|
var val = $("#"+item[i]["id"]).val();
|
|
|
|
|
if(fn_isNull(val) != ""){
|
|
|
|
|
if(is_float(val,Number(item[i]["start_num"]),Number(item[i]["end_num"])) == false || is_numberRange(val,Number(item[i]["start_num"]),Number(item[i]["end_num"])) == false){
|
|
|
|
|
alert($("#"+item[i]["id"]).attr("validNm") + "값의 범위를 확인하시기 바랍니다. (정수 : "+item[i]["start_num"]+"자리, 소수점 이하 : "+ item[i]["end_num"]+"자리)");
|
|
|
|
|
$("#"+item[i]["id"]).focus();
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//from , to 검사 (GRID 용)
|
|
|
|
|
function fn_fromToCheckGrid(type, gridRoot, dataGrid, grid, startIndex, fromIndex, toIndex){
|
|
|
|
|
|
|
|
|
|
//RowCount
|
|
|
|
|
var collection = gridRoot.getCollection();
|
|
|
|
|
var rowCount = collection.getLength();
|
|
|
|
|
|
|
|
|
|
//ColCount
|
|
|
|
|
var colCount = dataGrid.getColumnCount();
|
|
|
|
|
|
|
|
|
|
//title
|
|
|
|
|
var titlefield = "";
|
|
|
|
|
|
|
|
|
|
//COL
|
|
|
|
|
if(type == "COL"){
|
|
|
|
|
//title지정
|
|
|
|
|
if(startIndex == 2){
|
|
|
|
|
titlefield = "TITLE2";
|
|
|
|
|
}else{
|
|
|
|
|
titlefield = "TITLE";
|
|
|
|
|
}
|
|
|
|
|
//Col 검사
|
|
|
|
|
for(var i=startIndex; i<colCount; i++){
|
|
|
|
|
|
|
|
|
|
//컬럼정보
|
|
|
|
|
var col = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = col.getDataField();
|
|
|
|
|
|
|
|
|
|
//title
|
|
|
|
|
var fromtitle = gridRoot.getItemFieldAt(fromIndex, titlefield);
|
|
|
|
|
var totitle = gridRoot.getItemFieldAt(toIndex, titlefield);
|
|
|
|
|
|
|
|
|
|
//값
|
|
|
|
|
var fromval = gridRoot.getItemFieldAt(fromIndex, dataField);
|
|
|
|
|
var toval = gridRoot.getItemFieldAt(toIndex, dataField);
|
|
|
|
|
|
|
|
|
|
//from to 비교
|
|
|
|
|
if(fn_fromToCheckAlert(fromval, toval, fromtitle, totitle, "") == false){
|
|
|
|
|
setEditedItemPosition2(i, fromIndex , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ROW
|
|
|
|
|
if(type == "ROW"){
|
|
|
|
|
for(var r=0; r<rowCount; r++){
|
|
|
|
|
//컬럼정보
|
|
|
|
|
var fromCol = dataGrid.getColumns()[fromIndex];
|
|
|
|
|
var toCol = dataGrid.getColumns()[toIndex];
|
|
|
|
|
var fromDataField = fromCol.getDataField();
|
|
|
|
|
var toDataField = toCol.getDataField();
|
|
|
|
|
|
|
|
|
|
//헤더
|
|
|
|
|
var fromtitle = gridRoot.getObjectById(fromDataField).getHeaderText().replace("<br>",""); //헤더 텍스트
|
|
|
|
|
var totitle = gridRoot.getObjectById(toDataField).getHeaderText().replace("<br>",""); //헤더 텍스트
|
|
|
|
|
|
|
|
|
|
//값
|
|
|
|
|
var fromval = gridRoot.getItemFieldAt(r, fromDataField);
|
|
|
|
|
var toval = gridRoot.getItemFieldAt(r, toDataField);
|
|
|
|
|
|
|
|
|
|
//from to 비교
|
|
|
|
|
if(fn_fromToCheckAlert(fromval, toval, fromtitle, totitle, "") == false){
|
|
|
|
|
setEditedItemPosition2(fromIndex, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//실수 체크
|
|
|
|
|
function is_RegexFloat(v) {
|
|
|
|
|
var pattern = /^[+-]?\d*(\.?\d*)$/ ;
|
|
|
|
|
var reg=new RegExp(pattern);
|
|
|
|
|
return reg.test(v);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//실수체크
|
|
|
|
|
function fn_saveFloatCheck(type, gridRoot, dataGrid, grid, startIndex, dataIndex){
|
|
|
|
|
|
|
|
|
|
//RowCount
|
|
|
|
|
var collection = gridRoot.getCollection();
|
|
|
|
|
var rowCount = collection.getLength();
|
|
|
|
|
|
|
|
|
|
//ColCount
|
|
|
|
|
var colCount = dataGrid.getColumnCount();
|
|
|
|
|
|
|
|
|
|
//COL
|
|
|
|
|
if(type == "COL"){
|
|
|
|
|
//Row 검사
|
|
|
|
|
for(var r=0; r<rowCount; r++){
|
|
|
|
|
|
|
|
|
|
if(r == dataIndex){
|
|
|
|
|
for(var i=startIndex; i<colCount; i++){
|
|
|
|
|
var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val = gridRoot.getItemFieldAt(r, dataField);
|
|
|
|
|
if(fn_isNull(val) != "" && is_RegexFloat(val) == false){
|
|
|
|
|
alert("숫자로 입력하시기 바랍니다.");
|
|
|
|
|
fn_progressbarHide();
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//ROW
|
|
|
|
|
if(type == "ROW"){
|
|
|
|
|
|
|
|
|
|
for(var i=0; i<colCount; i++){
|
|
|
|
|
|
|
|
|
|
if(i == dataIndex){
|
|
|
|
|
for(var r=0; r<rowCount; r++){
|
|
|
|
|
var column = dataGrid.getColumns()[i];
|
|
|
|
|
var dataField = column.getDataField();
|
|
|
|
|
var val = gridRoot.getItemFieldAt(r, dataField);
|
|
|
|
|
if(fn_isNull(val) != "" && is_RegexFloat(val) == false){
|
|
|
|
|
alert("숫자로 입력하시기 바랍니다.");
|
|
|
|
|
fn_progressbarHide();
|
|
|
|
|
setEditedItemPosition2(i, r , grid, dataGrid);
|
|
|
|
|
return false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//버젼 호환성 문제로 trim fn_trim() 기술.
|
|
|
|
|
function fn_trim(SrcStr) {
|
|
|
|
|
return SrcStr.toString().replace(/^\s+|\s+$/gi, "");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//프로그래스바 생성.
|
|
|
|
|
function fn_progressbarLoding(){
|
|
|
|
|
|
|
|
|
|
var progressbarHtml = '<table width="100%" height="100%" style="background-color:#fff;text-align:center;opacity:0.5;filter:alpha(opacity=50);">';
|
|
|
|
|
progressbarHtml += '<tr valign="middle">';
|
|
|
|
|
progressbarHtml += '<td>';
|
|
|
|
|
progressbarHtml += '<span style="position:absolute;z-index:1000;font-size:15pt;color:#555;background:url(\'/home/images/upload.gif\') no-repeat center;">';
|
|
|
|
|
progressbarHtml += '<br/><br/><br/><br/><b>Data Uploading...</b>';
|
|
|
|
|
progressbarHtml += '</span>';
|
|
|
|
|
progressbarHtml += '</td>';
|
|
|
|
|
progressbarHtml += '</tr>';
|
|
|
|
|
progressbarHtml +='</table>';
|
|
|
|
|
|
|
|
|
|
$("#progressbarDiv").html(progressbarHtml);
|
|
|
|
|
$("#progressbarDiv").css({'top' : 0, 'left' : 0});
|
|
|
|
|
$("#progressbarDiv").css({'width' : '100%', 'height' : '100%' });
|
|
|
|
|
$("#progressbarDiv").removeClass("trViewOff");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//프로그래스바 이미지로 생성.
|
|
|
|
|
function fn_progressbarLoding_img(){
|
|
|
|
|
|
|
|
|
|
var progressbarHtml = '<table width="100%" height="100%" style="background-color:#fff;text-align:center;opacity:0.5;filter:alpha(opacity=50);">';
|
|
|
|
|
progressbarHtml += '<tr valign="middle">';
|
|
|
|
|
progressbarHtml += '<td>';
|
|
|
|
|
progressbarHtml += '<span style="position:absolute;z-index:1000;font-size:15pt;color:#555;">';
|
|
|
|
|
progressbarHtml += '<img src="/home/images/upload.gif" id="progressbarImg" style="padding-bottom:10px;"/><br/><b>Data Uploading...</b>';
|
|
|
|
|
progressbarHtml += '</span>';
|
|
|
|
|
progressbarHtml += '</td>';
|
|
|
|
|
progressbarHtml += '</tr>';
|
|
|
|
|
progressbarHtml +='</table>';
|
|
|
|
|
|
|
|
|
|
$("#progressbarDiv").html(progressbarHtml);
|
|
|
|
|
$("#progressbarImg").attr('src', '/home/images/upload.gif');
|
|
|
|
|
$("#progressbarDiv").css({'top' : 0, 'left' : 0});
|
|
|
|
|
$("#progressbarDiv").css({'width' : '100%', 'height' : '100%' });
|
|
|
|
|
$("#progressbarDiv").removeClass("trViewOff");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//프로그래스바 그리드일때 생성.
|
|
|
|
|
function fn_progressbarLoding_grid(){
|
|
|
|
|
|
|
|
|
|
var progressbarHtml = '<table width="100%" height="100%" style="background-color:#fff;text-align:center;opacity:0.5;filter:alpha(opacity=50);">';
|
|
|
|
|
progressbarHtml += '<tr valign="top">';
|
|
|
|
|
progressbarHtml += '<td>';
|
|
|
|
|
progressbarHtml += '<span style="position:absolute;z-index:1000;font-size:15pt;color:#555;top:50%;">';
|
|
|
|
|
progressbarHtml += '<img src="/home/images/upload.gif" id="progressbarImg" style="padding-bottom:10px;"/><br/><b>Data Uploading...</b>';
|
|
|
|
|
progressbarHtml += '</span>';
|
|
|
|
|
progressbarHtml += '</td>';
|
|
|
|
|
progressbarHtml += '</tr>';
|
|
|
|
|
progressbarHtml +='</table>';
|
|
|
|
|
|
|
|
|
|
$("#progressbarDiv").html(progressbarHtml);
|
|
|
|
|
$("#progressbarImg").attr('src', '/home/images/upload.gif');
|
|
|
|
|
$("#progressbarDiv").css({'top' : 0, 'left' : 0});
|
|
|
|
|
$("#progressbarDiv").css({'width' : '100%', 'height' : '100%' });
|
|
|
|
|
$("#progressbarDiv").removeClass("trViewOff");
|
|
|
|
|
}
|
|
|
|
|
//로딩바 숨김, 막은 그리드 해제
|
|
|
|
|
function fn_progressbarHide(){
|
|
|
|
|
$("#progressbarDiv").addClass("trViewOff");
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid) != 'undefined' ){
|
|
|
|
|
dataGrid.setEditable(true);
|
|
|
|
|
dataGrid.setPasteEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid1) != 'undefined' ){
|
|
|
|
|
dataGrid1.setEditable(true);
|
|
|
|
|
dataGrid1.setPasteEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid2) != 'undefined' ){
|
|
|
|
|
dataGrid2.setEditable(true);
|
|
|
|
|
dataGrid2.setPasteEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//그리드 있을 경우 Loading Bar때문에 미리 실행.
|
|
|
|
|
//그리드 막음.
|
2025-02-28 08:06:48 +00:00
|
|
|
function fn_save_loading(rUrl) {
|
2024-02-08 02:26:11 +00:00
|
|
|
fn_progressbarLoding_grid();
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid) != 'undefined' ){
|
|
|
|
|
dataGrid.setEditable(false);
|
|
|
|
|
dataGrid.setPasteEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid1) != 'undefined' ){
|
|
|
|
|
dataGrid1.setEditable(false);
|
|
|
|
|
dataGrid1.setPasteEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( typeof(dataGrid2) != 'undefined' ){
|
|
|
|
|
dataGrid2.setEditable(false);
|
|
|
|
|
dataGrid2.setPasteEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
/*var result = fn_save(rUrl);*/
|
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
|
|
|
var result = fn_save(rUrl);
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
fn_progressbarHide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (result === false) {
|
|
|
|
|
// progressbar 해제
|
|
|
|
|
fn_progressbarHide();
|
|
|
|
|
}
|
|
|
|
|
}, 100);
|
|
|
|
|
|
|
|
|
|
//setTimeout("fn_save('"+rUrl+"');",0.1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 그리드 추가 할때 textbox에서 enter체크
|
|
|
|
|
function fn_gridAddEnterKey(evt){
|
|
|
|
|
if ( evt.keyCode == 13) {
|
|
|
|
|
fn_rowChange();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Clip Report 화면호출 (유통자료 Reoprt 이미지 생성 관련 화면에 띄우기 위함)
|
|
|
|
|
function fn_openClipReport(table,project,hole,sample,etc1,etc2,gbn){
|
|
|
|
|
var msg = "수정한 내용이 있다면 저장후에 다시 실행바랍니다. \n\n미리보기를 진행할까요?";
|
|
|
|
|
if( confirm(msg) != 0 ){
|
|
|
|
|
var w = 880;
|
|
|
|
|
var h = 800;
|
|
|
|
|
var left = (screen.width)/2 -(w/2);
|
|
|
|
|
var top = (screen.height)/2 -(h/2);
|
|
|
|
|
|
|
|
|
|
var table_code = table;
|
|
|
|
|
var project_code = project;
|
|
|
|
|
var hole_code = hole;
|
|
|
|
|
var sample_code = sample;
|
|
|
|
|
var etc_code1 = etc1;
|
|
|
|
|
var etc_code2 = etc2;
|
|
|
|
|
var gbn = gbn;
|
|
|
|
|
|
|
|
|
|
var temp = "?table_code=" + table_code + "&project_code=" + project_code + "&hole_code=" + hole_code +
|
|
|
|
|
"&sample_code=" + sample_code + "&etc_code1=" + etc_code1 + "&etc_code2=" + etc_code2 + "&gbn=" + gbn;
|
|
|
|
|
|
|
|
|
|
window.open("/com/openClipReport.do" + temp, "clipReport","title=yes,toolbar=no,scrollbars=yes,resizable=yes,width="+w+",height="+h+",left=" + left + ",top=" + top);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-19 16:09:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function shakeAndHighlight(targetEle, message) {
|
|
|
|
|
var originalStyle = targetEle.style.border; // 원래 스타일 저장
|
|
|
|
|
|
|
|
|
|
// 빨간색 테두리 설정
|
|
|
|
|
targetEle.style.border = "2px solid red";
|
|
|
|
|
|
|
|
|
|
// 흔들리는 애니메이션 추가
|
|
|
|
|
targetEle.classList.add("shake-animation");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//alert
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
if( typeof message != 'undefined' ) {
|
|
|
|
|
//alert(message);
|
|
|
|
|
|
|
|
|
|
var snackbarEle = document.getElementById("snackbar");
|
|
|
|
|
if( typeof snackbarEle === 'undefined' || snackbarEle === null ) {
|
|
|
|
|
//snackbar 엘리먼트 생성
|
|
|
|
|
snackbarEle = createSnackBarEle();
|
|
|
|
|
}
|
|
|
|
|
snackbarEle.innerHTML = message;
|
|
|
|
|
}
|
|
|
|
|
}, 1);
|
|
|
|
|
|
|
|
|
|
// 3초 후 원래 스타일로 복원
|
|
|
|
|
setTimeout(function() {
|
|
|
|
|
targetEle.style.border = originalStyle;
|
|
|
|
|
targetEle.classList.remove("shake-animation");
|
|
|
|
|
//targetEle.focus();
|
|
|
|
|
showSnackbar();
|
|
|
|
|
}, 700);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function createSnackBarEle () {
|
|
|
|
|
const snackbar = document.createElement('div');
|
|
|
|
|
snackbar.id = 'snackbar';
|
|
|
|
|
|
|
|
|
|
// 2. body 태그 가져오기
|
|
|
|
|
const body = document.body;
|
|
|
|
|
|
|
|
|
|
// 3. body 태그 맨 아래에 snackbar 추가
|
|
|
|
|
body.appendChild(snackbar);
|
|
|
|
|
return snackbar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showSnackbar() {
|
|
|
|
|
// Get the snackbar DIV
|
|
|
|
|
var snackbar = document.getElementById("snackbar");
|
|
|
|
|
|
|
|
|
|
if( typeof snackbar === 'undefined' || snackbar === null ) {
|
|
|
|
|
//snackbar 엘리먼트 생성
|
|
|
|
|
snackbar = createSnackBarEle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Add the "show" class to DIV
|
|
|
|
|
snackbar.className = "show";
|
|
|
|
|
|
|
|
|
|
var innerText = snackbar.innerText;
|
|
|
|
|
innerText = String(innerText);
|
|
|
|
|
// After some seconds, remove the show class from DIV
|
|
|
|
|
|
|
|
|
|
const totalShowDuration = 4000 + innerText.length * 86;
|
|
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
snackbar.className = snackbar.className.replace("show", "");
|
|
|
|
|
}, totalShowDuration);
|
|
|
|
|
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
snackbar.style.visibility = 'hidden';
|
|
|
|
|
}, totalShowDuration - 500);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const remainingDuration = totalShowDuration / 1000 - (0.5 * 2);
|
|
|
|
|
|
|
|
|
|
// CSS 스타일을 JavaScript로 추가합니다.
|
|
|
|
|
snackbar.style.visibility = 'visible';
|
|
|
|
|
snackbar.style.animation = 'fadein 0.5s, fadeout 0.5s ' + String(remainingDuration) + 's';
|
|
|
|
|
snackbar.style.webkitAnimation = 'fadein 0.5s, fadeout 0.5s ' + String(remainingDuration) + 's';
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 한글 은/는 return 함수
|
|
|
|
|
*/
|
|
|
|
|
function getKoreanParticle(word) {
|
|
|
|
|
// 입력받은 문자열의 마지막 글자를 추출합니다.
|
|
|
|
|
const lastChar = word.slice(-1);
|
|
|
|
|
|
|
|
|
|
// 자음으로 끝나는 경우 '은'을, 모음으로 끝나는 경우 '는'을 반환합니다.
|
|
|
|
|
const consonants = 'ㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎ';
|
|
|
|
|
if (consonants.includes(lastChar)) {
|
|
|
|
|
return '은';
|
|
|
|
|
} else {
|
|
|
|
|
return '는';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 한글 로/으로 return 함수
|
|
|
|
|
*/
|
|
|
|
|
function getKoreanParticle2(word) {
|
|
|
|
|
word = String(word);
|
|
|
|
|
const lastChar = word.slice(-1);
|
|
|
|
|
const consonants = 'ㄱㄴㄷㄹㅁㅂㅅㅇㅈㅊㅋㅌㅍㅎ';
|
|
|
|
|
const numberConsonantsNeun = '036';
|
|
|
|
|
|
|
|
|
|
// 0, 3, 6만 으로 로 이어진다/
|
|
|
|
|
if (numberConsonantsNeun.includes(lastChar)) {
|
|
|
|
|
return '으로';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( hasNonNumericCharacters(lastChar) == false ) {
|
|
|
|
|
return '로';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 1. 'ㄹ'로 끝나는 경우 '로'를 사용합니다.
|
|
|
|
|
if (lastChar === 'ㄹ') {
|
|
|
|
|
return '로';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 2. 그 외 자음으로 끝나는 경우 '으로'를 사용합니다.
|
|
|
|
|
if (consonants.includes(lastChar)) {
|
|
|
|
|
return '으로';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 3. 모음으로 끝나는 경우 '로'를 사용합니다.
|
|
|
|
|
return '로';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function hasNonNumericCharacters(str) {
|
|
|
|
|
return /[^0-9]/.test(str);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeNonNumeric(str) {
|
|
|
|
|
let inputValue = String(str);
|
|
|
|
|
return inputValue.replace(/[^0-9]/g, '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
프로젝트 명 중복 체크
|
|
|
|
|
*/
|
|
|
|
|
function duplicateCheckProjectName( projectNameInput, projectCode ) {
|
|
|
|
|
|
|
|
|
|
if( typeof projectCode === 'undefined' || projectCode ==="null") {
|
|
|
|
|
projectCode = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
projectName = projectNameInput.value;
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : "GET",
|
|
|
|
|
data : {
|
|
|
|
|
projectName : projectName,
|
|
|
|
|
projectCode : projectCode,
|
|
|
|
|
isProjectNameChecking : "true"
|
|
|
|
|
},
|
|
|
|
|
url : "/project-duplicate-check.json",
|
|
|
|
|
dataType : "json",
|
|
|
|
|
success : function( json ){
|
|
|
|
|
resultData = json.result;
|
|
|
|
|
if(resultData == "false"){
|
|
|
|
|
shakeAndHighlight(projectNameInput, json.message);
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function(xhr, option, error){
|
|
|
|
|
alert(xhr.status); //오류코드
|
|
|
|
|
alert(error); //오류내용
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|