no message

main
이범준 1 year ago
parent eb401eaf64
commit 812fe8d74b

@ -39,6 +39,7 @@
<script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmPopup.js"></script> <script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmPopup.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmDateUtil.js"></script> <script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmDateUtil.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmUtil.js"></script> <script type="text/javascript" src="${ctx}/resources/js/fims/framework/cmm/cmmUtil.js"></script>
<script type="text/javascript" src="${ctx}/resources/js/base/dataset-fims.js"></script>
<%--TODO: 보완 필요 : 공통 ajax 호출 모듈과 통합 필요 --%> <%--TODO: 보완 필요 : 공통 ajax 호출 모듈과 통합 필요 --%>
<script type="text/javascript"> <script type="text/javascript">

@ -110,7 +110,6 @@ Date Author Description
// form object의 element 태그에 json data binding // form object의 element 태그에 json data binding
// name 속성으로 binding : name 속성 = json key 가 동일해야만 한다 // name 속성으로 binding : name 속성 = json key 가 동일해야만 한다
// format이 필요한 element : data-fmt-type 에 dt|day|time|number 로 set // format이 필요한 element : data-fmt-type 에 dt|day|time|number 로 set
// /webapp/resources/js/fims/framework/cmm/cmmUtil.js
// 사용예 : 단속관리 > 단속현황 관리 > 초기자료편집 - /WEB-INF/jsp/fims/biz/cmm/cmmCrackdownEditPopup.jsp // 사용예 : 단속관리 > 단속현황 관리 > 초기자료편집 - /WEB-INF/jsp/fims/biz/cmm/cmmCrackdownEditPopup.jsp
// 사용예 : 단속관리 > 단속현황 관리 > 개별총정보 - /WEB-INF/jsp/fims/biz/cmm/cmmCrackdownTotMgtPopup.jsp // 사용예 : 단속관리 > 단속현황 관리 > 개별총정보 - /WEB-INF/jsp/fims/biz/cmm/cmmCrackdownTotMgtPopup.jsp
let formFields = new FimsFormFields("#frm"); let formFields = new FimsFormFields("#frm");

@ -0,0 +1,172 @@
/**
* 숫자를 콤마 포멧으로 변환
**/
const CommaNumberFormat = {
format(value){
var reg = /(^[+-]?\d+)(\d{3})/;
value += '';
while (reg.test(value))
value = value.replace(reg, '$1' + ',' + '$2');
return value;
}
}
/**
* yyyyMMddHH24miss
* yyyy-MM-ddTHH24:mi:ss.xxxxxxZ
* @param {string} srcDateStr
* @param {string} delimiter
* @returns {string|*}
*/
const StrDateTimeFormat = {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\.|T|Z/g,'');
if(srcDate.length == 8) {
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8);
}else if(srcDate.length >= 14){
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8)
+ ' ' + srcDate.substring(8, 10) + ':' + srcDate.substring(10, 12) + ':' + srcDate.substring(12, 14);
}else{
return srcDate;
}
}
}
const StrDateFormat = {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\./g,'');
if(srcDate.length >= 8) {
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8);
}else{
return srcDate;
}
}
}
const StrTimeFormat= {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\./g,'');
if(srcDate.length >= 6) {
return srcDate.substring(0, 2)+":"+srcDate.substring(2, 4)+":"+srcDate.substring(4, 6);
}else{
return srcDate;
}
}
}
class CodeFormat {
_codeList;
constructor(codeList) {
this._codeList = codeList;
}
format(value) {
let txt = "";
for (let i=0; i<this._codeList.length; i++){
if(value == this._codeList[i].value){
txt = this._codeList[i].text;
}
}
return txt;
}
}
class FimsDatasetControl extends DatasetControl {
constructor(conf) {
super(conf);
this.dataset = new FimsDataset(conf);
this.infoSizes = conf.infoSizes || {};
this.titles = conf.titles || {};
}
_paginationInfo = {
paging : true,
pagingType : "nav",
pageNum : 1,
fetchSize : 15,
scrollFuncName : null
}
totalCountSetting(obj){
if(document.getElementById('totCnt')){
if(obj.data.pagination){ // 부분 조회
$('#totCnt span').text(obj.data.pagination.totalSize);
}else{ // 전체
$('#totCnt span').text(obj.count)
}
}
}
load(pageNum,flag) {
if(this._paginationInfo.paging){
this.query.pageNum = pageNum;
this.query.fetchSize = this._paginationInfo.fetchSize;
} else {
this.query.pageNum = 0;
this.query.fetchSize = 0;
}
this._load(flag);
}
_load(flag) {
if (!this.query.pageNum)
this.query.pageNum = 1;
json.get({
url:this.urls.load,
data:this.query,
success:resp => this.setData(resp,flag)
});
}
setData(obj, flag) {
this.dataset.setData(obj,flag);
}
}
class FimsDataset extends Dataset {
setData(obj, flag) {
let state = this.state;
this._byKeys = {};
this._current = null;
obj = obj || {};
let array = Array.isArray(obj) ? obj : this.conf.dataGetter(obj) || [];
if (!Array.isArray(array))
throw new Error("The data must be an array");
let oldItems = [];
if(flag != null && flag == "more"){
oldItems = this._items;
}
let newitems = [];
newitems = array.map(e => new DataItem(e, this._formats));
newitems.forEach(item => {
let key = "key-" + this.getKey(item.data);
this._byKeys[key] = item;
});
if(flag != null && flag == "more"){
this._items = oldItems.concat(newitems);
} else {
this._items = newitems;
}
this.onDatasetChange(obj);
this.setState(!Array.isArray(obj) ? obj.state : state);
this.onDirtiesChange(this.dirty);
return this;
}
}

@ -525,179 +525,10 @@ class FimsFormFields extends FormFields {
} }
} }
/**
* 숫자를 콤마 포멧으로 변환
**/
const CommaNumberFormat = {
format(value){
var reg = /(^[+-]?\d+)(\d{3})/;
value += '';
while (reg.test(value))
value = value.replace(reg, '$1' + ',' + '$2');
return value;
}
}
/**
* yyyyMMddHH24miss
* yyyy-MM-ddTHH24:mi:ss.xxxxxxZ
* @param {string} srcDateStr
* @param {string} delimiter
* @returns {string|*}
*/
const StrDateTimeFormat = {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\.|T|Z/g,'');
if(srcDate.length == 8) {
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8);
}else if(srcDate.length >= 14){
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8)
+ ' ' + srcDate.substring(8, 10) + ':' + srcDate.substring(10, 12) + ':' + srcDate.substring(12, 14);
}else{
return srcDate;
}
}
}
const StrDateFormat = {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\./g,'');
if(srcDate.length >= 8) {
return srcDate.substring(0, 4)+"-"+srcDate.substring(4, 6)+"-"+srcDate.substring(6, 8);
}else{
return srcDate;
}
}
}
const StrTimeFormat= {
format(value){
if(value == null || value.isBlank()) return value;
let srcDate = value.replace(/\-|\s|\:|\./g,'');
if(srcDate.length >= 6) {
return srcDate.substring(0, 2)+":"+srcDate.substring(2, 4)+":"+srcDate.substring(4, 6);
}else{
return srcDate;
}
}
}
class CodeFormat {
_codeList;
constructor(codeList) {
this._codeList = codeList;
}
format(value) {
let txt = "";
for (let i=0; i<this._codeList.length; i++){
if(value == this._codeList[i].value){
txt = this._codeList[i].text;
}
}
return txt;
}
}
class FimsDatasetControl extends DatasetControl {
constructor(conf) {
super(conf);
this.dataset = new FimsDataset(conf);
this.infoSizes = conf.infoSizes || {};
this.titles = conf.titles || {};
}
_paginationInfo = {
paging : true,
pagingType : "nav",
pageNum : 1,
fetchSize : 15,
scrollFuncName : null
}
totalCountSetting(obj){
if(document.getElementById('totCnt')){
if(obj.data.pagination){ // 부분 조회
$('#totCnt span').text(obj.data.pagination.totalSize);
}else{ // 전체
$('#totCnt span').text(obj.count)
}
}
}
load(pageNum,flag) {
if(this._paginationInfo.paging){
this.query.pageNum = pageNum;
this.query.fetchSize = this._paginationInfo.fetchSize;
} else {
this.query.pageNum = 0;
this.query.fetchSize = 0;
}
this._load(flag);
}
_load(flag) {
if (!this.query.pageNum)
this.query.pageNum = 1;
json.get({
url:this.urls.load,
data:this.query,
success:resp => this.setData(resp,flag)
});
}
setData(obj, flag) {
this.dataset.setData(obj,flag);
}
}
class FimsDataset extends Dataset {
setData(obj, flag) {
let state = this.state;
this._byKeys = {};
this._current = null;
obj = obj || {};
let array = Array.isArray(obj) ? obj : this.conf.dataGetter(obj) || [];
if (!Array.isArray(array))
throw new Error("The data must be an array");
let oldItems = [];
if(flag != null && flag == "more"){
oldItems = this._items;
}
let newitems = [];
newitems = array.map(e => new DataItem(e, this._formats));
newitems.forEach(item => {
let key = "key-" + this.getKey(item.data);
this._byKeys[key] = item;
});
if(flag != null && flag == "more"){
this._items = oldItems.concat(newitems);
} else {
this._items = newitems;
}
this.onDatasetChange(obj);
this.setState(!Array.isArray(obj) ? obj.state : state);
this.onDirtiesChange(this.dirty);
return this;
}
}
/** /**
* <pre> * <pre>

Loading…
Cancel
Save