Created
November 14, 2016 07:59
-
-
Save thomasJang/a9c33233d439efe873cc53356bdd5f44 to your computer and use it in GitHub Desktop.
axboot.config.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (axboot && axboot.def) { | |
axboot.def["DEFAULT_TAB_LIST"] = [ | |
{menuId: "00-dashboard", id: "dashboard", progNm: '홈', menuNm: '홈', progPh: '/jsp/dashboard.jsp', url: '/jsp/dashboard.jsp?progCd=dashboard', status: "on", fixed: true} | |
]; | |
axboot.def["API"] = { | |
"users": "/api/v1/users", | |
"commonCodes": "/api/v1/commonCodes", | |
"programs": "/api/v1/programs", | |
"menu": "/api/v2/menu", | |
"manual": "/api/v1/manual", | |
"errorLogs": "/api/v1/errorLogs", | |
"files": "/api/v1/files", | |
"samples": "/api/v1/samples", | |
"trans": "/api/v1/trans" | |
}; | |
axboot.def["MODAL"] = { | |
"ZIPCODE": { | |
width: 500, | |
height: 500, | |
iframe: { | |
url: "/jsp/common/zipcode.jsp" | |
}, | |
header: { | |
title: "우편번호 찾기" | |
} | |
}, | |
"SAMPLE-MODAL": { | |
width: 500, | |
height: 500, | |
iframe: { | |
url: "/jsp/_samples/modal.jsp" | |
}, | |
header: false | |
}, | |
"COMMON_CODE_MODAL": { | |
width: 600, | |
height: 400, | |
iframe: { | |
url: "/jsp/system/system-config-common-code-modal.jsp" | |
}, | |
header: false | |
}, | |
"STOR_TREE_FINDER_SS": { | |
width: 500, | |
height: 600, | |
header: false, | |
iframe: { | |
url: "/jsp/common/storeTreeFinder.jsp", | |
param: "selectMode=SS" | |
} | |
}, | |
"STOR_TREE_FINDER_SM": { | |
width: 500, | |
height: 600, | |
header: false, | |
iframe: { | |
url: "/jsp/common/storeTreeFinder.jsp", | |
param: "selectMode=SM" | |
} | |
}, | |
"STOR_TREE_FINDER_MM": { | |
width: 500, | |
height: 600, | |
header: false, | |
iframe: { | |
url: "/jsp/common/storeTreeFinder.jsp", | |
param: "selectMode=MM" | |
} | |
} | |
}; | |
} | |
var preDefineUrls = { | |
"manual_downloadForm": "/api/v1/manual/excel/downloadForm", | |
"manual_viewer": "/jsp/system/system-help-manual-view.jsp" | |
}; | |
axboot.getURL = function (url) { | |
if (ax5.util.isArray(url)) { | |
if (url[0] in preDefineUrls) { | |
url[0] = preDefineUrls[url[0]]; | |
} | |
return url.join('/'); | |
} else { | |
return url; | |
} | |
}; | |
axboot.gridBuilder.preDefineColumns = { | |
"createdAt": {width: 80, label: "등록일", align: "center", formatter: "date"}, | |
"updatedAt": {width: 80, label: "수정일", align: "center", formatter: "date"}, | |
"insDt": {width: 100, label: "등록일", align: "center"}, | |
"compCd": {width: 70, label: "업체코드", align: "center"}, | |
"compNm": {width: 110, label: "업체명", align: "left"}, | |
"storCd": {width: 70, label: "매장코드", align: "center"}, | |
"storNm": {width: 200, label: "매장명", align: "left"}, | |
"userNm": {width: 100, label: "이름", align: "center"}, | |
"itemCd": {width: 80, label: "품목코드", align: "center"}, | |
"itemNm": {width: 150, label: "품목명", align: "left"}, | |
"posItemNm": {width: 150, label: "POS단축명", align: "left"}, | |
"delYn": { | |
width: 50, label: "삭제", align: "center", formatter: function () { | |
return top.COMMON_CODE["DEL_YN"].map[this.value]; | |
} | |
}, | |
"useYn": { | |
width: 70, label: "사용여부", align: "center", formatter: function () { | |
return top.COMMON_CODE["USE_YN"].map[this.value]; | |
} | |
}, | |
"posUseYn": { | |
width: 90, label: "포스사용여부", align: "center", formatter: function () { | |
return top.COMMON_CODE["USE_YN"].map[this.value]; | |
} | |
}, | |
"sort": {width: 50, label: "정렬", align: "center"}, | |
"companyJson.대표자명": {width: 100, label: "대표자명", align: "center"}, | |
"companyJson.사업자등록번호": { | |
label: "사업자등록번호", | |
width: 120, | |
align: "center", | |
formatter: "bizno" | |
}, | |
"storeInfoJson.대표자명": {width: 100, label: "대표자명", align: "center"}, | |
"storeInfoJson.사업자등록번호": { | |
label: "사업자등록번호", | |
width: 120, | |
align: "center", | |
formatter: "bizno" | |
}, | |
"storeInfoJson.영업시작시간": { | |
label: "영업시작시간", | |
width: 100, | |
align: "center" | |
}, | |
"storeInfoJson.영업종료시간": { | |
label: "영업종료시간", | |
width: 100, | |
align: "center" | |
}, | |
"storeInfoJson.담당자": { | |
label: "담당자", | |
width: 70, | |
align: "center" | |
}, | |
"storeInfoJson.연락처": { | |
label: "연락처", | |
width: 100, | |
align: "center" | |
}, | |
"shopCd": {width: 100, label: "매장코드", align: "center"}, | |
"saleDate": {width: 90, label: "조회일자", align: "center", formatter: "date"}, | |
"posNo": {width: 60, label: "포스번호", align: "center"}, | |
"billNo": {width: 70, label: "영수증번호", align: "center"}, | |
"saleYn": { | |
width: 80, label: "판매구분", align: "center", formatter: function () { | |
return top.COMMON_CODE["SALE_FLAG"].map[this.value]; | |
} | |
}, | |
"sendFg": { | |
width: 80, label: "SR전송구분", align: "center", formatter: function () { | |
return top.COMMON_CODE["SEND_FLAG"].map[this.value]; | |
} | |
}, | |
"totSaleAmt": {width: 100, label: "총매출액", align: "right", formatter: "money"}, | |
"totDcAmt": {label: "총할인액", align: "right", formatter: "money"}, | |
"dcmSaleAmt": {label: "실매출액", align: "right", formatter: "money"}, | |
"vatAmt": {label: "부가세", align: "right", formatter: "money"}, | |
"noTaxSaleAmt": {label: "순매출(부가세제외)", align: "right", formatter: "money"}, | |
"cashAmt": {label: "현금매출", align: "right", formatter: "money"}, | |
"crdCardAmt": {label: "카드매출", align: "right", formatter: "money"}, | |
"wesAmt": {label: "외상매출", align: "right", formatter: "money"}, | |
"tkGftAmt": {label: "상품권", align: "right", formatter: "money"}, | |
"tkFodAmt": {label: "식권", align: "right", formatter: "money"}, | |
"cstPointAmt": {label: "포인트", align: "right", formatter: "money"}, | |
"payOutDt": {label: "결제시간", width: 140, align: "center", formatter: "datetime"}, | |
"noTaxSaleVat": {label: "순매출(부가세)", align: "right", formatter: "money"}, | |
"supplyAmt": {label: "공급가", align: "right", formatter: "money"}, | |
"rateDc": {label: "할인유형1(순매출포함)", align: "right", formatter: "money"}, | |
"notRateDc": {label: "할인유형2(순매출미포함)", align: "right", formatter: "money"}, | |
"dtlNo": {label: "순번"}, | |
"prodCd": {label: "상품코드"}, | |
"prodName": {label: "상품명"}, | |
"saleQty": {label: "판매수량", align: "right", formatter: "money"}, | |
"saleUprc": {label: "판매단가", align: "right", formatter: "money"}, | |
"saleAmt": {label: "총매출액", align: "right", formatter: "money"}, | |
"dcAmt": {label: "할인액", align: "right", formatter: "money"}, | |
"headerTotAmt": {label: "헤더금액", align: "right", formatter: "money"}, | |
"detailTotAmt": {label: "디테일금액", align: "right", formatter: "money"}, | |
"etcAmtSum": {label: "기타매출", align: "right", formatter: "money"} | |
}; | |
// 컬럼 확장 구문 | |
axboot.gridBuilder.preDefineColumns["locale"] = (function () { | |
return { | |
width: 120, label: "국가", align: "center", formatter: function () { | |
return parent.COMMON_CODE["LOCALE"].map[this.value]; | |
} | |
}; | |
})(); | |
axboot.gridBuilder.preDefineColumns["printerType"] = (function () { | |
return { | |
width: 100, label: "프린터 타입", align: "center", | |
formatter: function () { | |
return parent.COMMON_CODE["PRINTER_TYPE"].map[this.value]; | |
} | |
}; | |
})(); | |
axboot.gridBuilder.preDefineColumns["noticeType"] = (function () { | |
return { | |
width: 100, label: "구분", align: "center", | |
formatter: function () { | |
return parent.COMMON_CODE["NOTICE_TYPE"].map[this.value]; | |
} | |
}; | |
})(); | |
axboot.gridBuilder.preDefineColumns["importance"] = (function () { | |
return { | |
width: 80, label: "중요도", align: "center", | |
formatter: function () { | |
return parent.COMMON_CODE["NOTICE_IMPORTANCE"].map[this.value]; | |
} | |
}; | |
})(); | |
axboot.gridBuilder.preDefineEditor = { | |
"useYn": { | |
type: "select", config: { | |
columnKeys: { | |
optionValue: "CD", optionText: "NM" | |
}, | |
options: [ | |
{CD: "Y", NM: "사용"}, | |
{CD: "N", NM: "사용안함"} | |
] | |
} | |
}, | |
"checkYn": { | |
type: "checkbox", config: {trueValue: "Y", falseValue: "N"} | |
}, | |
"menu-program-auth-checkYn": { | |
type: "checkbox", config: {trueValue: "Y", falseValue: "N"}, | |
disabled: function () { | |
return this.item["program_" + this.key] == "N"; | |
} | |
}, | |
"number": { | |
type: "number" | |
}, | |
"text": { | |
type: "text" | |
}, | |
"PRINTER_TYPE": function () { | |
return { | |
type: "select", config: { | |
columnKeys: { | |
optionValue: "code", optionText: "name" | |
}, | |
options: parent.COMMON_CODE["PRINTER_TYPE"] | |
} | |
}; | |
} | |
}; | |
axboot.gridBuilder.preDefineEditorDisabled = { | |
"notCreated": function () { | |
return !this.item.__created__; | |
} | |
}; | |
ax5.ui.grid.formatter["bizno"] = function () { | |
var val = (this.value || "").replace(/\D/g, ""); | |
var regExpPattern = /^([0-9]{3})\-?([0-9]{1,2})?\-?([0-9]{1,5})?.*$/, | |
returnValue = val.replace(regExpPattern, function (a, b) { | |
var nval = [arguments[1]]; | |
if (arguments[2]) nval.push(arguments[2]); | |
if (arguments[3]) nval.push(arguments[3]); | |
return nval.join("-"); | |
}); | |
return returnValue; | |
}; | |
ax5.ui.grid.formatter["phone"] = function () { | |
var val = this.value.replace(/\D/g, ""); | |
var regExpPattern3 = /^([0-9]{3})\-?([0-9]{1,4})?\-?([0-9]{1,4})?\-?([0-9]{1,4})?\-?([0-9]{1,4})?/, | |
returnValue = val.replace(regExpPattern3, function (a, b) { | |
var nval = [arguments[1]]; | |
if (arguments[2]) nval.push(arguments[2]); | |
if (arguments[3]) nval.push(arguments[3]); | |
if (arguments[4]) nval.push(arguments[4]); | |
if (arguments[5]) nval.push(arguments[5]); | |
return nval.join("-"); | |
}); | |
return returnValue; | |
}; | |
ax5.ui.grid.formatter["date"] = function () { | |
return ax5.util.date(this.value, {"return": "yyyy-MM-dd"}); | |
}; | |
ax5.ui.grid.formatter["datetime"] = function () { | |
return ax5.util.date(this.value, {"return": "yyyy-MM-dd hh:mm:ss"}); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment